-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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(AWS CloudFront): Fix check for deprecated CacheBehavior properties #8768
fix(AWS CloudFront): Fix check for deprecated CacheBehavior properties #8768
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8768 +/- ##
=======================================
Coverage 87.60% 87.60%
=======================================
Files 260 260
Lines 9664 9664
=======================================
Hits 8466 8466
Misses 1198 1198
Continue to review full report at Codecov.
|
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.
Hello @DASPRiD, thanks for submitting this patch 🙇 It looks good, I have just one minor comment, please take a look at let me know what do you think
behaviorConfig.MinTTL !== null || | ||
behaviorConfig.MaxTTL !== null || | ||
behaviorConfig.DefaultTTL !== null | ||
behaviorConfig.MinTTL !== undefined || |
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.
What do you think about instead of checking for undefined, we'll check for != null
, which should cover both null
and undefined
values properly in that check?
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.
null
should not be allowed at all – CloudFormation will complain that null
is not a valid value.
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.
👍
Thanks for the quick processing – considering the last release was only 6 hours ago, any chance that there'll be a hotfix release anytime soon? :) |
@DASPRiD Most likely we will have a new release coming up sometime next week as we're wrapping up a few bigger features. Hope that works 👍 |
While trying to add a lambda@edge function with a cloudfront event, I ran into an issue. I assume that this is an edge case, which is why it wasn't caught so far:
My cloudFront event is specifying a cachePolicy and at the same time a behavior with AllowedMethods and CachedMethods. Independently they work as expected, but when combining them, a broken check triggers.
That check tests for deprecated properties, but instead of checking for the values being
undefined
, it checks if they arenull
, which is not a valid value in regards to CloudFormation.This PR fixes that check and introduces a unit test to make sure it won't break again in the future.