AliasPropsο
- class aws_cdk.aws_lambda.AliasProps(*, max_event_age=None, on_failure=None, on_success=None, retry_attempts=None, additional_versions=None, description=None, provisioned_concurrent_executions=None, alias_name, version)ο
Bases:
AliasOptionsProperties for a new Lambda alias.
- Parameters:
max_event_age (
Optional[Duration]) β The maximum age of a request that Lambda sends to a function for processing. Minimum: 60 seconds Maximum: 6 hours Default: Duration.hours(6)on_failure (
Optional[IDestination]) β The destination for failed invocations. Default: - no destinationon_success (
Optional[IDestination]) β The destination for successful invocations. Default: - no destinationretry_attempts (
Union[int,float,None]) β The maximum number of times to retry when the function returns an error. Minimum: 0 Maximum: 2 Default: 2additional_versions (
Optional[Sequence[Union[VersionWeight,Dict[str,Any]]]]) β Additional versions with individual weights this alias points to. Individual additional version weights specified here should add up to (less than) one. All remaining weight is routed to the default version. For example, the config is version: β1β additionalVersions: [{ version: β2β, weight: 0.05 }] Then 5% of traffic will be routed to function version 2, while the remaining 95% of traffic will be routed to function version 1. Default: No additional versionsdescription (
Optional[str]) β Description for the alias. Default: No descriptionprovisioned_concurrent_executions (
Union[int,float,None]) β Specifies a provisioned concurrency configuration for a functionβs alias. Default: No provisioned concurrencyalias_name (
str) β Name of this alias.version (
IVersion) β Function version this alias refers to. Use lambda.currentVersion to reference a version with your latest changes.
- ExampleMetadata:
infused
Example:
lambda_code = lambda_.Code.from_cfn_parameters() func = lambda_.Function(self, "Lambda", code=lambda_code, handler="index.handler", runtime=lambda_.Runtime.NODEJS_LATEST ) # used to make sure each CDK synthesis produces a different Version version = func.current_version alias = lambda_.Alias(self, "LambdaAlias", alias_name="Prod", version=version ) codedeploy.LambdaDeploymentGroup(self, "DeploymentGroup", alias=alias, deployment_config=codedeploy.LambdaDeploymentConfig.LINEAR_10PERCENT_EVERY_1MINUTE )
Attributes
- additional_versionsο
Additional versions with individual weights this alias points to.
Individual additional version weights specified here should add up to (less than) one. All remaining weight is routed to the default version.
For example, the config is
version: β1β additionalVersions: [{ version: β2β, weight: 0.05 }]
Then 5% of traffic will be routed to function version 2, while the remaining 95% of traffic will be routed to function version 1.
- Default:
No additional versions
- alias_nameο
Name of this alias.
- descriptionο
Description for the alias.
- Default:
No description
- max_event_ageο
The maximum age of a request that Lambda sends to a function for processing.
Minimum: 60 seconds Maximum: 6 hours
- Default:
Duration.hours(6)
- on_failureο
The destination for failed invocations.
- Default:
no destination
- on_successο
The destination for successful invocations.
- Default:
no destination
- provisioned_concurrent_executionsο
Specifies a provisioned concurrency configuration for a functionβs alias.
- Default:
No provisioned concurrency
- retry_attemptsο
The maximum number of times to retry when the function returns an error.
Minimum: 0 Maximum: 2
- Default:
2
- versionο
Function version this alias refers to.
Use lambda.currentVersion to reference a version with your latest changes.