Skip to content
v2.273.0

LambdaDeploymentConfig L2 construct ​

A custom Deployment Configuration for a Lambda Deployment Group.

Example ​

ts
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,
});
python
# application: codedeploy.LambdaApplication
# alias: lambda.Alias
config = codedeploy.LambdaDeploymentConfig(self, "CustomConfig",
    traffic_routing=codedeploy.TimeBasedCanaryTrafficRouting(
        interval=Duration.minutes(15),
        percentage=5
    )
)
deployment_group = codedeploy.LambdaDeploymentGroup(self, "BlueGreenDeployment",
    application=application,
    alias=alias,
    deployment_config=config
)
java
LambdaApplication application;
Alias alias;
LambdaDeploymentConfig config = LambdaDeploymentConfig.Builder.create(this, "CustomConfig")
        .trafficRouting(TimeBasedCanaryTrafficRouting.Builder.create()
                .interval(Duration.minutes(15))
                .percentage(5)
                .build())
        .build();
LambdaDeploymentGroup deploymentGroup = LambdaDeploymentGroup.Builder.create(this, "BlueGreenDeployment")
        .application(application)
        .alias(alias)
        .deploymentConfig(config)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
LambdaApplication application;
Alias alias;
var config = new LambdaDeploymentConfig(this, "CustomConfig", new LambdaDeploymentConfigProps {
    TrafficRouting = new TimeBasedCanaryTrafficRouting(new TimeBasedCanaryTrafficRoutingProps {
        Interval = Duration.Minutes(15),
        Percentage = 5
    })
});
var deploymentGroup = new LambdaDeploymentGroup(this, "BlueGreenDeployment", new LambdaDeploymentGroupProps {
    Application = application,
    Alias = alias,
    DeploymentConfig = config
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var application LambdaApplication
var alias Alias
config := codedeploy.NewLambdaDeploymentConfig(this, jsii.String("CustomConfig"), &LambdaDeploymentConfigProps{
	TrafficRouting: codedeploy.NewTimeBasedCanaryTrafficRouting(&TimeBasedCanaryTrafficRoutingProps{
		Interval: awscdk.Duration_Minutes(jsii.Number(15)),
		Percentage: jsii.Number(5),
	}),
})
deploymentGroup := codedeploy.NewLambdaDeploymentGroup(this, jsii.String("BlueGreenDeployment"), &LambdaDeploymentGroupProps{
	Application: Application,
	Alias: Alias,
	DeploymentConfig: config,
})

Initializer ​

ts
new LambdaDeploymentConfig(scope: Construct, id: string, props?: LambdaDeploymentConfigProps)
python
LambdaDeploymentConfig(scope: Construct, id: str, props: typing.Optional[LambdaDeploymentConfigProps] = None)
java
new LambdaDeploymentConfig(Construct scope, String id, LambdaDeploymentConfigProps props)
csharp
new LambdaDeploymentConfig(Construct scope, string id, LambdaDeploymentConfigProps? props = null)
go
NewLambdaDeploymentConfig(Scope Construct, Id *string, Props LambdaDeploymentConfigProps)

Construct Props ​

deploymentConfigNamestringdeployment_config_namestrdeploymentConfigNameStringDeploymentConfigNamestringDeploymentConfigName*string= automatically generated name#
The physical, human-readable name of the Deployment Configuration.
trafficRoutingTrafficRoutingtraffic_routingTrafficRoutingtrafficRoutingTrafficRoutingTrafficRoutingTrafficRoutingTrafficRoutingTrafficRouting= AllAtOnce#
The configuration that specifies how traffic is shifted from the 'blue' target group to the 'green' target group during a deployment.

Properties ​

CodeDeploy predefined deployment configuration that shifts all traffic to the updated Lambda function at once.
CANARY_10PERCENT_10MINUTESILambdaDeploymentConfigcanary_10_percent_10_minutesILambdaDeploymentConfigCANARY_10PERCENT_10MINUTESILambdaDeploymentConfigCANARY_10PERCENT_10MINUTESILambdaDeploymentConfigCANARY_10PERCENT_10MINUTESILambdaDeploymentConfigrequiredstatic#
CodeDeploy predefined deployment configuration that shifts 10 percent of traffic in the first increment.

The remaining 90 percent is deployed 10 minutes later.

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

The remaining 90 percent is deployed 15 minutes later.

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

The remaining 90 percent is deployed 30 minutes later.

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

The remaining 90 percent is deployed five minutes later.

deploymentConfigArnstringdeployment_config_arnstrdeploymentConfigArnStringDeploymentConfigArnstringDeploymentConfigArn*stringrequired#
The ARN of the Deployment Configuration.
deploymentConfigNamestringdeployment_config_namestrdeploymentConfigNameStringDeploymentConfigNamestringDeploymentConfigName*stringrequired#
The physical, human-readable name of the Deployment Configuration.
deploymentConfigRefDeploymentConfigReferencedeployment_config_refDeploymentConfigReferencedeploymentConfigRefDeploymentConfigReferenceDeploymentConfigRefDeploymentConfigReferenceDeploymentConfigRefDeploymentConfigReferencerequired#
A reference to a DeploymentConfig resource.
The environment this resource belongs to.
notes

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

LINEAR_10PERCENT_EVERY_10MINUTESILambdaDeploymentConfiglinear_10_percent_every_10_minutesILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_10MINUTESILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_10MINUTESILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_10MINUTESILambdaDeploymentConfigrequiredstatic#
CodeDeploy predefined deployment configuration that shifts 10 percent of traffic every 10 minutes until all traffic is shifted.
LINEAR_10PERCENT_EVERY_1MINUTEILambdaDeploymentConfiglinear_10_percent_every_1_minuteILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_1MINUTEILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_1MINUTEILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_1MINUTEILambdaDeploymentConfigrequiredstatic#
CodeDeploy predefined deployment configuration that shifts 10 percent of traffic every minute until all traffic is shifted.
LINEAR_10PERCENT_EVERY_2MINUTESILambdaDeploymentConfiglinear_10_percent_every_2_minutesILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_2MINUTESILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_2MINUTESILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_2MINUTESILambdaDeploymentConfigrequiredstatic#
CodeDeploy predefined deployment configuration that shifts 10 percent of traffic every two minutes until all traffic is shifted.
LINEAR_10PERCENT_EVERY_3MINUTESILambdaDeploymentConfiglinear_10_percent_every_3_minutesILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_3MINUTESILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_3MINUTESILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_3MINUTESILambdaDeploymentConfigrequiredstatic#
CodeDeploy predefined deployment configuration that shifts 10 percent of traffic every three minutes until all traffic is shifted.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#
Uniquely identifies this class.
stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this resource is defined.

Methods ​

applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Override the cross-stack reference strength for this resource.
notes · 1 parameter

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#
Apply the given removal policy to this resource.
notes

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).

fromLambdaDeploymentConfigName(scope: Construct, id: string, lambdaDeploymentConfigName: string): ILambdaDeploymentConfig@staticmethod def from_lambda_deployment_config_name(scope: Construct, id: str, lambda_deployment_config_name: str) -> ILambdaDeploymentConfigpublic static ILambdaDeploymentConfig fromLambdaDeploymentConfigName(Construct scope, String id, String lambdaDeploymentConfigName)public static ILambdaDeploymentConfig FromLambdaDeploymentConfigName(Construct scope, string id, string lambdaDeploymentConfigName)func FromLambdaDeploymentConfigName(Scope Construct, Id *string, LambdaDeploymentConfigName *string) ILambdaDeploymentConfigstatic#
Import a Deployment Configuration for a Lambda Deployment Group defined outside the CDK.
3 parameters · returns

Parameters

  • scopescopescopescopeScope — the parent Construct for this new Construct.
  • ididididId — the logical ID of this new Construct.
  • lambdaDeploymentConfigNamelambda_deployment_config_namelambdaDeploymentConfigNamelambdaDeploymentConfigNameLambdaDeploymentConfigName — the name of the Lambda Deployment Configuration to import.

Returns: a Construct representing a reference to an existing Lambda Deployment Configuration

import(_scope: Construct, _id: string, props: LambdaDeploymentConfigImportProps): ILambdaDeploymentConfig@staticmethod def import(_scope: Construct, _id: str, props: LambdaDeploymentConfigImportProps) -> ILambdaDeploymentConfigpublic static ILambdaDeploymentConfig import(Construct _scope, String _id, LambdaDeploymentConfigImportProps props)public static ILambdaDeploymentConfig Import(Construct _scope, string _id, LambdaDeploymentConfigImportProps props)func Import(_scope Construct, _id *string, Props LambdaDeploymentConfigImportProps) ILambdaDeploymentConfigstaticdeprecated#
use `fromLambdaDeploymentConfigName`
3 parameters · returns

Parameters

  • _scope_scope_scope_scope_scope — the parent Construct for this new Construct.
  • _id_id_id_id_id — the logical ID of this new Construct.
  • propspropspropspropsProps — the properties of the referenced custom Deployment Configuration.

Returns: a Construct representing a reference to an existing custom Deployment Configuration

isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#
Returns true if the construct was created by CDK, and false otherwise.
isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#
Check whether the given construct is a Resource.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.