aws-cdk-lib.aws_codedeploy.LambdaDeploymentConfig

class LambdaDeploymentConfig (construct)

LanguageType name
.NETAmazon.CDK.AWS.CodeDeploy.LambdaDeploymentConfig
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscodedeploy#LambdaDeploymentConfig
Javasoftware.amazon.awscdk.services.codedeploy.LambdaDeploymentConfig
Pythonaws_cdk.aws_codedeploy.LambdaDeploymentConfig
TypeScript (source)aws-cdk-lib » aws_codedeploy » LambdaDeploymentConfig

Implements IConstruct, IDependable, IResource, IBaseDeploymentConfig, ILambdaDeploymentConfig

A custom Deployment Configuration for a Lambda Deployment Group.

Example

const config = new codedeploy.LambdaDeploymentConfig(this, 'CustomConfig', {
  trafficRouting: new codedeploy.TimeBasedCanaryTrafficRouting({
    interval: Duration.minutes(15),
    percentage: 5,
  }),
});

declare const application: codedeploy.LambdaApplication;
declare const alias: lambda.Alias;
const deploymentGroup = new codedeploy.LambdaDeploymentGroup(this, 'BlueGreenDeployment', {
  application,
  alias,
  deploymentConfig: config,
});

Initializer

new LambdaDeploymentConfig(scope: Construct, id: string, props?: LambdaDeploymentConfigProps)

Parameters

  • scope Construct
  • id string
  • props LambdaDeploymentConfigProps

Construct Props

NameTypeDescription
deploymentConfigName?stringThe physical, human-readable name of the Deployment Configuration.
trafficRouting?TrafficRoutingThe configuration that specifies how traffic is shifted from the 'blue' target group to the 'green' target group during a deployment.

deploymentConfigName?

Type: string (optional, default: automatically generated name)

The physical, human-readable name of the Deployment Configuration.


trafficRouting?

Type: TrafficRouting (optional, default: AllAtOnce)

The configuration that specifies how traffic is shifted from the 'blue' target group to the 'green' target group during a deployment.

Properties

NameTypeDescription
deploymentConfigArnstringThe arn of the deployment config.
deploymentConfigNamestringThe name of the deployment config.
envResourceEnvironmentThe environment this resource belongs to.
nodeNodeThe tree node.
stackStackThe stack in which this resource is defined.
static ALL_AT_ONCEILambdaDeploymentConfigCodeDeploy predefined deployment configuration that shifts all traffic to the updated Lambda function at once.
static CANARY_10PERCENT_10MINUTESILambdaDeploymentConfigCodeDeploy predefined deployment configuration that shifts 10 percent of traffic in the first increment.
static CANARY_10PERCENT_15MINUTESILambdaDeploymentConfigCodeDeploy predefined deployment configuration that shifts 10 percent of traffic in the first increment.
static CANARY_10PERCENT_30MINUTESILambdaDeploymentConfigCodeDeploy predefined deployment configuration that shifts 10 percent of traffic in the first increment.
static CANARY_10PERCENT_5MINUTESILambdaDeploymentConfigCodeDeploy predefined deployment configuration that shifts 10 percent of traffic in the first increment.
static LINEAR_10PERCENT_EVERY_10MINUTESILambdaDeploymentConfigCodeDeploy predefined deployment configuration that shifts 10 percent of traffic every 10 minutes until all traffic is shifted.
static LINEAR_10PERCENT_EVERY_1MINUTEILambdaDeploymentConfigCodeDeploy predefined deployment configuration that shifts 10 percent of traffic every minute until all traffic is shifted.
static LINEAR_10PERCENT_EVERY_2MINUTESILambdaDeploymentConfigCodeDeploy predefined deployment configuration that shifts 10 percent of traffic every two minutes until all traffic is shifted.
static LINEAR_10PERCENT_EVERY_3MINUTESILambdaDeploymentConfigCodeDeploy predefined deployment configuration that shifts 10 percent of traffic every three minutes until all traffic is shifted.

deploymentConfigArn

Type: string

The arn of the deployment config.


deploymentConfigName

Type: string

The name of the deployment config.


env

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


node

Type: Node

The tree node.


stack

Type: Stack

The stack in which this resource is defined.


static ALL_AT_ONCE

Type: ILambdaDeploymentConfig

CodeDeploy predefined deployment configuration that shifts all traffic to the updated Lambda function at once.


static CANARY_10PERCENT_10MINUTES

Type: ILambdaDeploymentConfig

CodeDeploy predefined deployment configuration that shifts 10 percent of traffic in the first increment.

The remaining 90 percent is deployed 10 minutes later.


static CANARY_10PERCENT_15MINUTES

Type: ILambdaDeploymentConfig

CodeDeploy predefined deployment configuration that shifts 10 percent of traffic in the first increment.

The remaining 90 percent is deployed 15 minutes later.


static CANARY_10PERCENT_30MINUTES

Type: ILambdaDeploymentConfig

CodeDeploy predefined deployment configuration that shifts 10 percent of traffic in the first increment.

The remaining 90 percent is deployed 30 minutes later.


static CANARY_10PERCENT_5MINUTES

Type: ILambdaDeploymentConfig

CodeDeploy predefined deployment configuration that shifts 10 percent of traffic in the first increment.

The remaining 90 percent is deployed five minutes later.


static LINEAR_10PERCENT_EVERY_10MINUTES

Type: ILambdaDeploymentConfig

CodeDeploy predefined deployment configuration that shifts 10 percent of traffic every 10 minutes until all traffic is shifted.


static LINEAR_10PERCENT_EVERY_1MINUTE

Type: ILambdaDeploymentConfig

CodeDeploy predefined deployment configuration that shifts 10 percent of traffic every minute until all traffic is shifted.


static LINEAR_10PERCENT_EVERY_2MINUTES

Type: ILambdaDeploymentConfig

CodeDeploy predefined deployment configuration that shifts 10 percent of traffic every two minutes until all traffic is shifted.


static LINEAR_10PERCENT_EVERY_3MINUTES

Type: ILambdaDeploymentConfig

CodeDeploy predefined deployment configuration that shifts 10 percent of traffic every three minutes until all traffic is shifted.

Methods

NameDescription
applyRemovalPolicy(policy)Apply the given removal policy to this resource.
toString()Returns a string representation of this construct.
static fromLambdaDeploymentConfigName(scope, id, lambdaDeploymentConfigName)Import a Deployment Configuration for a Lambda Deployment Group defined outside the CDK.
static import(_scope, _id, props)⚠️Import a Deployment Configuration for a Lambda Deployment Group defined outside the CDK.

applyRemovalPolicy(policy)

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.


static fromLambdaDeploymentConfigName(scope, id, lambdaDeploymentConfigName)

public static fromLambdaDeploymentConfigName(scope: Construct, id: string, lambdaDeploymentConfigName: string): ILambdaDeploymentConfig

Parameters

  • scope Construct — the parent Construct for this new Construct.
  • id string — the logical ID of this new Construct.
  • lambdaDeploymentConfigName string — the name of the Lambda Deployment Configuration to import.

Returns

  • ILambdaDeploymentConfig

Import a Deployment Configuration for a Lambda Deployment Group defined outside the CDK.


static import(_scope, _id, props)⚠️

public static import(_scope: Construct, _id: string, props: LambdaDeploymentConfigImportProps): ILambdaDeploymentConfig

⚠️ Deprecated: use fromLambdaDeploymentConfigName

Parameters

  • _scope Construct — the parent Construct for this new Construct.
  • _id string — the logical ID of this new Construct.
  • props LambdaDeploymentConfigImportProps — the properties of the referenced custom Deployment Configuration.

Returns

  • ILambdaDeploymentConfig

Import a Deployment Configuration for a Lambda Deployment Group defined outside the CDK.