Skip to content
v2.277.0

CfnCodeDeployLambdaAliasUpdate Struct ​

To perform an AWS CodeDeploy deployment when the version changes on an AWS::Lambda::Alias resource, use the CodeDeployLambdaAliasUpdate update policy.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const cfnCodeDeployLambdaAliasUpdate: cdk.CfnCodeDeployLambdaAliasUpdate = {
  applicationName: 'applicationName',
  deploymentGroupName: 'deploymentGroupName',

  // the properties below are optional
  afterAllowTrafficHook: 'afterAllowTrafficHook',
  beforeAllowTrafficHook: 'beforeAllowTrafficHook',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk

cfn_code_deploy_lambda_alias_update = cdk.CfnCodeDeployLambdaAliasUpdate(
    application_name="applicationName",
    deployment_group_name="deploymentGroupName",

    # the properties below are optional
    after_allow_traffic_hook="afterAllowTrafficHook",
    before_allow_traffic_hook="beforeAllowTrafficHook"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;

CfnCodeDeployLambdaAliasUpdate cfnCodeDeployLambdaAliasUpdate = CfnCodeDeployLambdaAliasUpdate.builder()
        .applicationName("applicationName")
        .deploymentGroupName("deploymentGroupName")

        // the properties below are optional
        .afterAllowTrafficHook("afterAllowTrafficHook")
        .beforeAllowTrafficHook("beforeAllowTrafficHook")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;

var cfnCodeDeployLambdaAliasUpdate = new CfnCodeDeployLambdaAliasUpdate {
    ApplicationName = "applicationName",
    DeploymentGroupName = "deploymentGroupName",

    // the properties below are optional
    AfterAllowTrafficHook = "afterAllowTrafficHook",
    BeforeAllowTrafficHook = "beforeAllowTrafficHook"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"

cfnCodeDeployLambdaAliasUpdate := &CfnCodeDeployLambdaAliasUpdate{
	ApplicationName: jsii.String("applicationName"),
	DeploymentGroupName: jsii.String("deploymentGroupName"),

	// the properties below are optional
	AfterAllowTrafficHook: jsii.String("afterAllowTrafficHook"),
	BeforeAllowTrafficHook: jsii.String("beforeAllowTrafficHook"),
}

Properties ​

afterAllowTrafficHookoptionalstringafter_allow_traffic_hookoptionalstrafterAllowTrafficHookoptionalStringAfterAllowTrafficHookoptionalstringAfterAllowTrafficHookoptional*string#
The name of the Lambda function to run after traffic routing completes.
applicationNamestringapplication_namestrapplicationNameStringApplicationNamestringApplicationName*stringrequired#
The name of the AWS CodeDeploy application.
beforeAllowTrafficHookoptionalstringbefore_allow_traffic_hookoptionalstrbeforeAllowTrafficHookoptionalStringBeforeAllowTrafficHookoptionalstringBeforeAllowTrafficHookoptional*string#
The name of the Lambda function to run before traffic routing starts.
deploymentGroupNamestringdeployment_group_namestrdeploymentGroupNameStringDeploymentGroupNamestringDeploymentGroupName*stringrequired#
The name of the AWS CodeDeploy deployment group.

This is where the traffic-shifting policy is set.