Class AliasProps
Properties for a new Lambda alias.
Inheritance
Namespace: Amazon.CDK.AWS.Lambda
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class AliasProps : Object, IAliasProps, IAliasOptions, IEventInvokeConfigOptions
Syntax (vb)
Public Class AliasProps
Inherits Object
Implements IAliasProps, IAliasOptions, IEventInvokeConfigOptions
Remarks
ExampleMetadata: infused
Examples
var lambdaCode = Code.FromCfnParameters();
var func = new Function(this, "Lambda", new FunctionProps {
Code = lambdaCode,
Handler = "index.handler",
Runtime = Runtime.NODEJS_LATEST
});
// used to make sure each CDK synthesis produces a different Version
var version = func.CurrentVersion;
var alias = new Alias(this, "LambdaAlias", new AliasProps {
AliasName = "Prod",
Version = version
});
new LambdaDeploymentGroup(this, "DeploymentGroup", new LambdaDeploymentGroupProps {
Alias = alias,
DeploymentConfig = LambdaDeploymentConfig.LINEAR_10PERCENT_EVERY_1MINUTE
});
Synopsis
Constructors
AliasProps() |
Properties
AdditionalVersions | Additional versions with individual weights this alias points to. |
AliasName | Name of this alias. |
Description | Description for the alias. |
MaxEventAge | The maximum age of a request that Lambda sends to a function for processing. |
OnFailure | The destination for failed invocations. |
OnSuccess | The destination for successful invocations. |
ProvisionedConcurrentExecutions | Specifies a provisioned concurrency configuration for a function's alias. |
RetryAttempts | The maximum number of times to retry when the function returns an error. |
Version | Function version this alias refers to. |
Constructors
AliasProps()
public AliasProps()
Properties
AdditionalVersions
Additional versions with individual weights this alias points to.
public IVersionWeight[] AdditionalVersions { get; set; }
Property Value
Remarks
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
AliasName
Name of this alias.
public string AliasName { get; set; }
Property Value
System.String
Description
Description for the alias.
public string Description { get; set; }
Property Value
System.String
Remarks
Default: No description
MaxEventAge
The maximum age of a request that Lambda sends to a function for processing.
public Duration MaxEventAge { get; set; }
Property Value
Remarks
Minimum: 60 seconds Maximum: 6 hours
Default: Duration.hours(6)
OnFailure
The destination for failed invocations.
public IDestination OnFailure { get; set; }
Property Value
Remarks
Default: - no destination
OnSuccess
The destination for successful invocations.
public IDestination OnSuccess { get; set; }
Property Value
Remarks
Default: - no destination
ProvisionedConcurrentExecutions
Specifies a provisioned concurrency configuration for a function's alias.
public Nullable<double> ProvisionedConcurrentExecutions { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Default: No provisioned concurrency
RetryAttempts
The maximum number of times to retry when the function returns an error.
public Nullable<double> RetryAttempts { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Minimum: 0 Maximum: 2
Default: 2
Version
Function version this alias refers to.
public IVersion Version { get; set; }
Property Value
Remarks
Use lambda.currentVersion to reference a version with your latest changes.