Skip to content

Commit b3edd0d

Browse files
authored
feat(autoscaling): add new HealthChecks for multiple health check types, including EBS and VPC_LATTICE types (#31286)
### Issue # (if applicable) Closes #31289 . ### Reason for this change Only ONE HealthCheckType can be selected for an existing healthCheck property: EC2 or ELB. https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-autoscaling/lib/auto-scaling-group.ts#L233 https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-autoscaling/lib/auto-scaling-group.ts#L2232-L2258 However, the current CFn specification allows multiple health check types to be specified, separated by commas. > A comma-separated value string of one or more health check types. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html#cfn-autoscaling-autoscalinggroup-healthchecktype Also, besides EC2 and ELB, EBS and VPC_LATTICE can now be configured. > The valid values are EC2, EBS, ELB, and VPC_LATTICE. EC2 is the default health check and cannot be disabled. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html#cfn-autoscaling-autoscalinggroup-healthchecktype If it was just EC2 and ELB, there would not be a need for multiple specifications. (Because specifying EC2 and another type at the same time would result in [a CFn error](#31286 (comment)). **This means that when specifying an ELB, it is a single specification.**) But the increase in the number of these property types makes multiple specifications necessary. Therefore, **it is good to support the specification of multiple health check types and the addition of new types at the same time.** See the docs for more details. https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-health-checks.html ### Description of changes So, I add a new `HealthChecks` class and `healthChecks` property. - One or more health check types can be selected. - Added EBS and VPC_LATTIC types. And I deprecated the existing `healthCheck` property. ### Description of how you validated changes 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 4879c04 commit b3edd0d

13 files changed

+3182
-5
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/AutoScalingGroupHealthChecksDefaultTestDeployAssert9AAA1F3B.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-autoscaling/test/integ.health-checks.js.snapshot/AutoScalingGroupHealthChecksDefaultTestDeployAssert9AAA1F3B.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-autoscaling/test/integ.health-checks.js.snapshot/cdk.out

+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-autoscaling/test/integ.health-checks.js.snapshot/integ-health-checks.assets.json

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

0 commit comments

Comments
 (0)