-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
(aws_cloudfront.experimental): EdgeFunction fails updating when upgrading to cdk v2 #17810
Comments
I seemed to have the exact same issue, although using the I might be wrong, but my guess is that I was only encountering this bug now since previously my functions' metadata or tags were never updated, or only updated when the code itself also changed. Not sure if this is also what is happening in your case, but thought it might be useful to share :) |
Thank you so much for pointing me to this @encron @njlynch As this feature flag is pretty new (I think?), and as the migration guide advice us to drop all the feature flags, it might be a good thing to add this error to the Troubleshooting section of the migration guide? Otherwise, we can close this issue. Thanks again @encron 🙏 |
The `@aws-cdk/aws-lambda:recognizeVersionProps` feature flag has always had the "future" behavior set to "true", meaning any new projects get the flag set to true. All of these style flags were intended to default to true as well for v2, but this one was missed. The end result is that users who have created a new v1 project anytime in the last ~6 months, and then upgrade to v2, actually experience a _downgrade_ in behavior if following the offical migration guide (which instructs users to delete all feature flags). This change fixes the behavior to work as intended. Users who wish to opt out can continue to set `@aws-cdk/aws-lambda:recognizeVersionProps` to false in their `cdk.json`. fixes #17810
Thanks for the bug report, @ChristopheBougere ! This is a regression in behavior with V2. The intent was that any feature flag that was previously set to "true" for new projects, was automatically handled as "true" by default in v2 (without needing the flag to be set). Somehow this one got lost in the shuffle and reverted back to v1 behavior, where the flag needs to be explicitly set. I've created a fix (#17866), which should (🤞 ) go out with the next v2 release. |
…ly (#17866) The `@aws-cdk/aws-lambda:recognizeVersionProps` feature flag has always had the "future" behavior set to "true", meaning any new projects get the flag set to true. All of these style flags were intended to default to true as well for v2, but this one was missed. The end result is that users who have created a new v1 project anytime in the last ~6 months, and then upgrade to v2, actually experience a _downgrade_ in behavior if following the offical migration guide (which instructs users to delete all feature flags). This change fixes the behavior to work as intended. Users who wish to opt out can continue to set `@aws-cdk/aws-lambda:recognizeVersionProps` to false in their `cdk.json`. fixes #17810 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
What is the problem?
I'm trying to upgrade my app to CDK v2.
I have a
cloudfront.experimental.EdgeFunction
in my main stack (which is used in substacks). After upgrading everything to V2 and bootstraping again, CloudFormation is failing with the following error:Reproduction Steps
What did you expect to happen?
I was expecting it to deploy without error (as nothing changed in my code, I just upgraded).
The Lambda function shouldn't be created, but just modified.
What actually happened?
The Edge function fails creating. Here is the interesting part of
cdk diff
I ran before deploying:We can see that a
/
has been added in theAWS::Lambda::Version
logical ID, I wonder if that is the cause.CDK CLI Version
2.0.0 (build 4b6ce31)
Framework Version
2.0.0
Node.js Version
v14.16.0
OS
macOS 12.0.1
Language
Typescript
Language Version
3.9.7
Other information
No response
The text was updated successfully, but these errors were encountered: