Skip to content
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

fix: Ensure the healthcheck for a Target Group is legal #762

Merged
merged 2 commits into from
Aug 26, 2021

Conversation

akash1810
Copy link
Member

@akash1810 akash1810 commented Aug 26, 2021

What does this change?

A Target Group's healthcheck must have a timeout lower than the interval.

Annoyingly, AWS CDK doesn't catch this and will happily synth a stack that violates this rule. This change checks that timeout is less than interval and throws otherwise to prevent synth from completing.

See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-health-check.html#cfn-elb-healthcheck-timeout.

This follows the changes made in #738.

Does this change require changes to existing projects or CDK CLI?

No.

Does this change require changes to the library documentation?

I don't think so.

How to test

See added test.

How can we measure success?

Illegal CloudFormation is caught early (at build time rather than runtime).

Have we considered potential risks?

n/a

A Target Group's healthcheck must have a timeout lower than the interval.

Annoyingly, AWS CDK doesn't catch this and will happily synth a stack that violates this rule.
This change checks that `timeout` is less than `interval` and throws otherwise to prevent synth from completing.

See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-health-check.html#cfn-elb-healthcheck-timeout.
@akash1810 akash1810 requested a review from a team August 26, 2021 13:01
Copy link
Contributor

@jacobwinch jacobwinch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this 💯

@akash1810 akash1810 merged commit a4d1655 into main Aug 26, 2021
@akash1810 akash1810 deleted the aa-healthcheck-error branch August 26, 2021 13:47
@github-actions
Copy link
Contributor

🎉 This PR is included in version 23.5.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

akash1810 added a commit to guardian/cdk-playground that referenced this pull request Aug 26, 2021
This is to fix a healthcheck issue that's preventing the CFN stack from updating.

See: guardian/cdk#762
@akash1810
Copy link
Member Author

akash1810 commented Sep 6, 2021

This has been fixed upstream now too in v1.121.0 - aws/aws-cdk#16107.

Update: the change is only available when calling configureHealthCheck explicitly and not in the constructor. Have raised the question to the AWS CDK team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants