-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(autoscaling): add new HealthChecks
for multiple health check types, including EBS and VPC_LATTICE types
#31286
base: main
Are you sure you want to change the base?
Conversation
HealthChecks
instead of old HealthCheck
HealthChecks
instead of old HealthCheck
HealthChecks
for multiple health check types, including EBS and VPC_LATTICE types
/** | ||
* Additional Health Check Type | ||
*/ | ||
export enum AdditionalHealthCheckType { | ||
/** | ||
* ELB Health Check | ||
*/ | ||
ELB = 'ELB', | ||
/** | ||
* EBS Health Check | ||
*/ | ||
EBS = 'EBS', | ||
/** | ||
* VPC LATTICE Health Check | ||
*/ | ||
VPC_LATTICE = 'VPC_LATTICE', | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EC2 had to be excluded because specifying EC2 and other types together would result in a CFn error.
Resource handler returned message: "Specifying EC2 in addition to other health check types is not supported. Remove EC2 from HealthCheckType and try again. (Service: AutoScaling, Status Code: 400, Request ID: ...
* @default Duration.seconds(0) | ||
* @see https://docs.aws.amazon.com/autoscaling/ec2/userguide/health-check-grace-period.html | ||
*/ | ||
readonly grace?: Duration; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The grace
has to be specified in the existing ELB options, but this is not necessary now. (I actually deployed the configuration without the grace
successfully).
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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.
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.
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. 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 andhealthChecks
property.And I deprecated the existing
healthCheck
property.Description of how you validated changes
Unit and integ tests.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license