LambdaDeploymentConfig L2 construct
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,
});
# 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
)
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();
// 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
});
// 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
new LambdaDeploymentConfig(scope: Construct, id: string, props?: LambdaDeploymentConfigProps)
LambdaDeploymentConfig(scope: Construct, id: str, props: typing.Optional[LambdaDeploymentConfigProps] = None)
new LambdaDeploymentConfig(Construct scope, String id, LambdaDeploymentConfigProps props)
new LambdaDeploymentConfig(Construct scope, string id, LambdaDeploymentConfigProps? props = null)
NewLambdaDeploymentConfig(Scope Construct, Id *string, Props LambdaDeploymentConfigProps)
Construct Props
deploymentConfigNamestringdeployment_config_namestrdeploymentConfigNameStringDeploymentConfigNamestringDeploymentConfigName*string= automatically generated name#trafficRoutingTrafficRoutingtraffic_routingTrafficRoutingtrafficRoutingTrafficRoutingTrafficRoutingTrafficRoutingTrafficRoutingTrafficRouting= AllAtOnce#Properties
ALL_AT_ONCEILambdaDeploymentConfigall_at_onceILambdaDeploymentConfigALL_AT_ONCEILambdaDeploymentConfigALL_AT_ONCEILambdaDeploymentConfigALL_AT_ONCEILambdaDeploymentConfigrequiredstatic#CANARY_10PERCENT_10MINUTESILambdaDeploymentConfigcanary_10_percent_10_minutesILambdaDeploymentConfigCANARY_10PERCENT_10MINUTESILambdaDeploymentConfigCANARY_10PERCENT_10MINUTESILambdaDeploymentConfigCANARY_10PERCENT_10MINUTESILambdaDeploymentConfigrequiredstatic#The remaining 90 percent is deployed 10 minutes later.
CANARY_10PERCENT_15MINUTESILambdaDeploymentConfigcanary_10_percent_15_minutesILambdaDeploymentConfigCANARY_10PERCENT_15MINUTESILambdaDeploymentConfigCANARY_10PERCENT_15MINUTESILambdaDeploymentConfigCANARY_10PERCENT_15MINUTESILambdaDeploymentConfigrequiredstatic#The remaining 90 percent is deployed 15 minutes later.
CANARY_10PERCENT_30MINUTESILambdaDeploymentConfigcanary_10_percent_30_minutesILambdaDeploymentConfigCANARY_10PERCENT_30MINUTESILambdaDeploymentConfigCANARY_10PERCENT_30MINUTESILambdaDeploymentConfigCANARY_10PERCENT_30MINUTESILambdaDeploymentConfigrequiredstatic#The remaining 90 percent is deployed 30 minutes later.
CANARY_10PERCENT_5MINUTESILambdaDeploymentConfigcanary_10_percent_5_minutesILambdaDeploymentConfigCANARY_10PERCENT_5MINUTESILambdaDeploymentConfigCANARY_10PERCENT_5MINUTESILambdaDeploymentConfigCANARY_10PERCENT_5MINUTESILambdaDeploymentConfigrequiredstatic#The remaining 90 percent is deployed five minutes later.
deploymentConfigArnstringdeployment_config_arnstrdeploymentConfigArnStringDeploymentConfigArnstringDeploymentConfigArn*stringrequired#deploymentConfigNamestringdeployment_config_namestrdeploymentConfigNameStringDeploymentConfigNamestringDeploymentConfigName*stringrequired#deploymentConfigRefDeploymentConfigReferencedeployment_config_refDeploymentConfigReferencedeploymentConfigRefDeploymentConfigReferenceDeploymentConfigRefDeploymentConfigReferenceDeploymentConfigRefDeploymentConfigReferencerequired#envResourceEnvironmentenvResourceEnvironmentenvResourceEnvironmentEnvResourceEnvironmentEnvResourceEnvironmentrequired#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#LINEAR_10PERCENT_EVERY_1MINUTEILambdaDeploymentConfiglinear_10_percent_every_1_minuteILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_1MINUTEILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_1MINUTEILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_1MINUTEILambdaDeploymentConfigrequiredstatic#LINEAR_10PERCENT_EVERY_2MINUTESILambdaDeploymentConfiglinear_10_percent_every_2_minutesILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_2MINUTESILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_2MINUTESILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_2MINUTESILambdaDeploymentConfigrequiredstatic#LINEAR_10PERCENT_EVERY_3MINUTESILambdaDeploymentConfiglinear_10_percent_every_3_minutesILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_3MINUTESILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_3MINUTESILambdaDeploymentConfigLINEAR_10PERCENT_EVERY_3MINUTESILambdaDeploymentConfigrequiredstatic#PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#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)#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)#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#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#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#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#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#toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#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.