Skip to content
v2.274.0

CfnCodeDeployBlueGreenHook L1 construct ​

A CloudFormation Hook for CodeDeploy blue-green ECS deployments.

Example ​

ts
declare const cfnTemplate: cfn_inc.CfnInclude;
const hook: core.CfnHook = cfnTemplate.getHook('MyOutput');

// mutating the hook
declare const myRole: iam.Role;
const codeDeployHook = hook as core.CfnCodeDeployBlueGreenHook;
codeDeployHook.serviceRole = myRole.roleArn;
python
# cfn_template: cfn_inc.CfnInclude

# mutating the hook
# my_role: iam.Role

hook = cfn_template.get_hook("MyOutput")
code_deploy_hook = hook
code_deploy_hook.service_role = my_role.role_arn
java
CfnInclude cfnTemplate;

// mutating the hook
Role myRole;

CfnHook hook = cfnTemplate.getHook("MyOutput");
CfnCodeDeployBlueGreenHook codeDeployHook = (CfnCodeDeployBlueGreenHook)hook;
codeDeployHook.getServiceRole() = myRole.getRoleArn();
csharp
// Install: dotnet add package Amazon.CDK.Lib
CfnInclude cfnTemplate;

// mutating the hook
Role myRole;

var hook = cfnTemplate.GetHook("MyOutput");
var codeDeployHook = (CfnCodeDeployBlueGreenHook)hook;
codeDeployHook.ServiceRole = myRole.RoleArn;
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var cfnTemplate CfnInclude

// mutating the hook
var myRole Role

hook := cfnTemplate.GetHook(jsii.String("MyOutput"))
codeDeployHook := hook.(CfnCodeDeployBlueGreenHook)
codeDeployHook.serviceRole = myRole.roleArn

Initializer ​

ts
new CfnCodeDeployBlueGreenHook(scope: Construct, id: string, props: CfnCodeDeployBlueGreenHookProps)
python
CfnCodeDeployBlueGreenHook(scope: Construct, id: str, props: CfnCodeDeployBlueGreenHookProps)
java
new CfnCodeDeployBlueGreenHook(Construct scope, String id, CfnCodeDeployBlueGreenHookProps props)
csharp
new CfnCodeDeployBlueGreenHook(Construct scope, string id, CfnCodeDeployBlueGreenHookProps props)
go
NewCfnCodeDeployBlueGreenHook(Scope Construct, Id *string, Props CfnCodeDeployBlueGreenHookProps)

Construct Props ​

additionalOptionsoptionalCfnCodeDeployBlueGreenAdditionalOptionsadditional_optionsoptionalCfnCodeDeployBlueGreenAdditionalOptionsadditionalOptionsoptionalCfnCodeDeployBlueGreenAdditionalOptionsAdditionalOptionsoptionalCfnCodeDeployBlueGreenAdditionalOptionsAdditionalOptionsoptionalCfnCodeDeployBlueGreenAdditionalOptions#
Additional options for the blue/green deployment.

Default: no additional options

Properties of the Amazon ECS applications being deployed.
lifecycleEventHooksoptionalCfnCodeDeployBlueGreenLifecycleEventHookslifecycle_event_hooksoptionalCfnCodeDeployBlueGreenLifecycleEventHookslifecycleEventHooksoptionalCfnCodeDeployBlueGreenLifecycleEventHooksLifecycleEventHooksoptionalCfnCodeDeployBlueGreenLifecycleEventHooksLifecycleEventHooksoptionalCfnCodeDeployBlueGreenLifecycleEventHooks#
Use lifecycle event hooks to specify a Lambda function that CodeDeploy can call to validate a deployment.

Default: no lifecycle event hooks

notes

You can use the same function or a different one for deployment lifecycle events. Following completion of the validation tests, the Lambda CfnCodeDeployBlueGreenLifecycleEventHooks.afterAllowTraffic function calls back CodeDeploy and delivers a result of 'Succeeded' or 'Failed'.

serviceRolestringservice_rolestrserviceRoleStringServiceRolestringServiceRole*stringrequired#
The IAM Role for CloudFormation to use to perform blue-green deployments.
trafficRoutingConfigoptionalCfnTrafficRoutingConfigtraffic_routing_configoptionalCfnTrafficRoutingConfigtrafficRoutingConfigoptionalCfnTrafficRoutingConfigTrafficRoutingConfigoptionalCfnTrafficRoutingConfigTrafficRoutingConfigoptionalCfnTrafficRoutingConfig#
Traffic routing configuration settings.

Default: time-based canary traffic shifting, with a 15% step percentage and a five minute bake time

Properties ​

additionalOptionsmay be undefinedCfnCodeDeployBlueGreenAdditionalOptionsadditional_optionsmay be undefinedCfnCodeDeployBlueGreenAdditionalOptionsadditionalOptionsmay be undefinedCfnCodeDeployBlueGreenAdditionalOptionsAdditionalOptionsmay be undefinedCfnCodeDeployBlueGreenAdditionalOptionsAdditionalOptionsmay be undefinedCfnCodeDeployBlueGreenAdditionalOptions#
Additional options for the blue/green deployment.

Default: no additional options

Properties of the Amazon ECS applications being deployed.
creationStackstring[]creation_stacktyping.List[str]creationStackList<String>CreationStackstring[]CreationStack*[]*stringrequired#
lifecycleEventHooksmay be undefinedCfnCodeDeployBlueGreenLifecycleEventHookslifecycle_event_hooksmay be undefinedCfnCodeDeployBlueGreenLifecycleEventHookslifecycleEventHooksmay be undefinedCfnCodeDeployBlueGreenLifecycleEventHooksLifecycleEventHooksmay be undefinedCfnCodeDeployBlueGreenLifecycleEventHooksLifecycleEventHooksmay be undefinedCfnCodeDeployBlueGreenLifecycleEventHooks#
Use lifecycle event hooks to specify a Lambda function that CodeDeploy can call to validate a deployment.

Default: no lifecycle event hooks

notes

You can use the same function or a different one for deployment lifecycle events. Following completion of the validation tests, the Lambda CfnCodeDeployBlueGreenLifecycleEventHooks.afterAllowTraffic function calls back CodeDeploy and delivers a result of 'Succeeded' or 'Failed'.

logicalIdstringlogical_idstrlogicalIdStringLogicalIdstringLogicalId*stringrequired#
The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
serviceRolestringservice_rolestrserviceRoleStringServiceRolestringServiceRole*stringrequired#
The IAM Role for CloudFormation to use to perform blue-green deployments.
stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

trafficRoutingConfigmay be undefinedCfnTrafficRoutingConfigtraffic_routing_configmay be undefinedCfnTrafficRoutingConfigtrafficRoutingConfigmay be undefinedCfnTrafficRoutingConfigTrafficRoutingConfigmay be undefinedCfnTrafficRoutingConfigTrafficRoutingConfigmay be undefinedCfnTrafficRoutingConfig#
Traffic routing configuration settings.

Default: time-based canary traffic shifting, with a 15% step percentage and a five minute bake time

typestringtypestrtypeStringTypestringType*stringrequired#
The type of the hook (for example, "AWS::CodeDeploy::BlueGreen").

Methods ​

isCfnElement(x: any): boolean@staticmethod def is_cfn_element(x: Any) -> boolpublic static Boolean isCfnElement(Object x)public static bool IsCfnElement(object x)func IsCfnElement(X interface{}) *boolstatic#
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

returns

Returns: The construct as a stack element or undefined if it is not a stack element.

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.

overrideLogicalId(newLogicalId: string): voiddef override_logical_id(self, new_logical_id: str) -> Nonepublic void overrideLogicalId(String newLogicalId)public void OverrideLogicalId(string newLogicalId)func OverrideLogicalId(NewLogicalId *string)#
Overrides the auto-generated logical ID with a specific ID.
1 parameter

Parameters

  • newLogicalIdnew_logical_idnewLogicalIdnewLogicalIdNewLogicalId — The new logical ID to use for this stack element.
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.