Skip to content

Commit

Permalink
feat(codedeploy): termination hook (#30644)
Browse files Browse the repository at this point in the history
### 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*
  • Loading branch information
badmintoncryer committed Jun 26, 2024
1 parent 9597b92 commit 8f652a7
Show file tree
Hide file tree
Showing 12 changed files with 331 additions and 201 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,8 @@
"CodeDeployGroupRole1D304F7A",
"Arn"
]
}
},
"TerminationHookEnabled": true
}
}
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8f652a7

Please sign in to comment.