create_alias
async
¶
create_alias(
function_name: FunctionName,
name: Alias,
function_version: VersionWithLatestPublished,
*,
config_overrides: Optional[AsyncLambdaClientConfig] = None,
description: Optional[Description] = None,
routing_config: Optional[AliasRoutingConfiguration] = None,
) -> AliasConfiguration
Creates an alias for a Lambda Event Function version. Use aliases to provide clients with a function identifier that you can update to invoke a different version.
You can also map an alias to split invocation requests between two versions. Use the RoutingConfig parameter to specify a second version and the percentage of invocation requests that it receives.
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(VersionWithLatestPublished) –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.
Raises:
-
AliasLimitExceededException–Lambda couldn't create the alias because your Amazon Web Services account has exceeded the maximum number of aliases allowed per Lambda function. For more information, see Lambda quotas.
-
InvalidParameterValueException–One of the parameters in the request is not valid.
-
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 create an alias for a Lambda function The following example creates an alias named LIVE that points to version 1 of the my-function Lambda function.
>>> await client.create_alias(description='alias for live version of function', function_name='my-function', function_version='1', name='LIVE')
Source code in docs_src/capo_lambda/_services/async__lambda.py
5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 | |