# CfnCodeDeployLambdaAliasUpdate

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

- Source: [`core/lib/cfn-resource-policy.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/core/lib/cfn-resource-policy.ts#L284)

## Example

TypeScript:

```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:

```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:

```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();
```

C# / .NET:

```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"
};
```

Golang:

```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

- `afterAllowTrafficHook`: string — The name of the Lambda function to run after traffic routing completes.

- `applicationName`: string (required) — The name of the AWS CodeDeploy application.

- `beforeAllowTrafficHook`: string — The name of the Lambda function to run before traffic routing starts.

- `deploymentGroupName`: string (required) — The name of the AWS CodeDeploy deployment group.

  This is where the traffic-shifting policy is set.
