update_alias
async
¶
update_alias(
function_name: FunctionName,
name: Alias,
*,
config_overrides: Optional[AsyncLambdaClientConfig] = 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.
>>> await 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/async__lambda.py
5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 | |