Skip to content

Commit 8f652a7

Browse files
feat(codedeploy): termination hook (#30644)
### Issue # (if applicable) None ### Reason for this change Deployment group supports a termination hook for EC2 compute type but CDK L2 construct does not support this. ### Description of changes Added `terminationHook` to `ServerDeploymentGroupProps` ```ts new codedeploy.ServerDeploymentGroup(stack, 'DeploymentGroup', { autoScalingGroups: [ new autoscaling.AutoScalingGroup(stack, 'ASG', { instanceType: ec2.InstanceType.of(ec2.InstanceClass.STANDARD3, ec2.InstanceSize.SMALL), machineImage: new ec2.AmazonLinuxImage(), vpc: new ec2.Vpc(stack, 'VPC'), }), ], terminationHook: true, // add }); ``` ### Description of how you validated changes Added both unit and integ tests ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 9597b92 commit 8f652a7

12 files changed

+331
-201
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/server/integ.deployment-group.js.snapshot/aws-cdk-codedeploy-server-dg.assets.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/server/integ.deployment-group.js.snapshot/aws-cdk-codedeploy-server-dg.template.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,8 @@
773773
"CodeDeployGroupRole1D304F7A",
774774
"Arn"
775775
]
776-
}
776+
},
777+
"TerminationHookEnabled": true
777778
}
778779
}
779780
},

packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/server/integ.deployment-group.js.snapshot/cdk.out

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/server/integ.deployment-group.js.snapshot/integ.json

+5-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/server/integ.deployment-group.js.snapshot/integdeploymentgroupDefaultTestDeployAssert282ECB20.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/server/integ.deployment-group.js.snapshot/integdeploymentgroupDefaultTestDeployAssert282ECB20.template.json

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/server/integ.deployment-group.js.snapshot/manifest.json

+43-58
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)