create_alias
¶
create_alias(
function_name: FunctionName,
name: Alias,
function_version: VersionWithLatestPublished,
*,
config_overrides: Optional[LambdaClientConfig] = 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.
>>> 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/_lambda.py
5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 | |