-
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
aws-lambda: version incorrectly created when function property changes but value stays the same #27889
Comments
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Sorry for the late response! |
I suspect this is because |
That was my suspicion as well (although it doesn't seem to reproduce for @pahud) This also happened to me and my team where seemingly innocuous changes such as this were made and merged only to be discovered as breaking deployments at a later stage Also not sure how this can be resolved if it is indeed the issue |
Looks like you experienced the same/similar issue as I reported here: #25997 |
Describe the bug
This case is a bit convoluted but it happened to me multiple times, this is only my assumption of what's happening.
For a given function:
When deployed a version will be correctly created, now assuming "ValueFromOtherStack" is exported as the string "test", if we change the deployment code to be:
Without changing the function code, could be for the sake of changing the exported value (since you can't change export if they are already in use), the internal logic of Version will recalculate the logical id (this is my assumption) since the properties changed, yet when deploying to CF, CF will see the function's configuration to be the same and refuse to create a new version resulting in the following error:
Version already exists: [...]. Please modify the function to create a new version.
Expected Behavior
Not sure, either creating a new version or not is fine by me but this fails deployment and happens quite frequently for me
Current Behavior
Deployment fails and an artificial change has to be done to one of the function's properties.
If this was one function that would be one thing, but this happens for me on multiple occasions for multiple functions
Reproduction Steps
Deploy function with the first code example
Attempt to deploy function with the second code example without changing any other property or function code and see the deployment fail
Possible Solution
Not sure how can this be solved since CDK is right to assume the logical id changes here since the property changed, but it cannot see the values are the same due to them being deploy time variables
Additional Information/Context
No response
CDK CLI Version
2.102.0
Framework Version
No response
Node.js Version
any
OS
any
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: