Commit 8f652a7
authored
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
Lines changed: 331 additions & 201 deletions
File tree
- packages
- @aws-cdk-testing/framework-integ/test/aws-codedeploy/test/server
- integ.deployment-group.js.snapshot
- aws-cdk-lib/aws-codedeploy
- lib/server
- test/server
Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
773 | 773 | | |
774 | 774 | | |
775 | 775 | | |
776 | | - | |
| 776 | + | |
| 777 | + | |
777 | 778 | | |
778 | 779 | | |
779 | 780 | | |
| |||
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 43 additions & 58 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments