update_alias
¶
update_alias(
function_name: FunctionName,
name: Alias,
*,
config_overrides: Optional[LambdaClientConfig] = None,
function_version: Optional[VersionWithLatestPublished] = None,
description: Optional[Description] = None,
routing_config: Optional[AliasRoutingConfiguration] = None,
revision_id: Optional[String] = None,
) -> AliasConfiguration
Updates the configuration of a Lambda Event Function alias.
Parameters:
-
function_name(FunctionName) –The name or ARN of the Lambda function.
Name formats
-
Function name -
MyFunction. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction. -
Partial ARN -
123456789012:function:MyFunction.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
-
-
name(Alias) –The name of the alias.
-
function_version(Optional[VersionWithLatestPublished], default:None) –The function version that the alias invokes.
-
description(Optional[Description], default:None) –A description of the alias.
-
routing_config(Optional[AliasRoutingConfiguration], default:None) –The routing configuration of the alias.
-
revision_id(Optional[String], default:None) –Only update the alias if the revision ID matches the ID that's specified. Use this option to avoid modifying an alias that has changed since you last read it.
Raises:
-
InvalidParameterValueException–One of the parameters in the request is not valid.
-
PreconditionFailedException–The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.
-
For AddPermission and RemovePermission API operations: Call
GetPolicyto retrieve the latest RevisionId for your resource. -
For all other API operations: Call
GetFunctionorGetAliasto retrieve the latest RevisionId for your resource.
-
-
ResourceConflictException–The resource already exists, or another operation is in progress.
-
ResourceNotFoundException–The resource specified in the request does not exist.
-
ServiceException–The Lambda service encountered an internal error.
-
TooManyRequestsException–The request throughput limit was exceeded. For more information, see Lambda quotas.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To update a function alias The following example updates the alias named BLUE to send 30% of traffic to version 2 and 70% to version 1.
>>> client.update_alias(function_name='my-function', function_version='2', name='BLUE', routing_config={'AdditionalVersionWeights': {'1': 0.7}})
Source code in docs_src/capo_lambda/_services/_lambda.py
5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 | |