-
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
sam: cdk diff returns nothing when codeUri or events are changed #29185
Comments
internal tracking: V1258335352 |
With the new change set based diff implemented in #28336 we are asking the CFN service for a list of changes. However the changes reported by CFN look like this:
Most notably, they are pointing to changes in a lambda function. This lambda function does not exists in the local template, since locally we have a SAM Function. Thus the diff tool fails to connect the reported diff the local template and silently drops the change. |
Arguably the
|
### Issue # (if applicable) Closes #29185 ### Reason for this change CFN applies the SAM transform before the changeset is created. This means that SAM resources become their underlying CFN types in the template that the changeset operates on. This means that the changeset is operating on resources that we don't see in our template. ### Description of changes Before, if we saw properties in our diff that were not in the changeset (like `codeUri` for `Serverless::Function`, which doesn't appear in the changeset, because it becomes `Code` for `Lambda::Function`), we'd filter them out of the diff. We now skip this process for SAM resources. ### Description of how you validated changes unit test ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the bug
cdk diff
returns nothing when I change thecodeUri
orevents
prop of sam.CfnFunctionExpected Behavior
cdk diff
should return the changeCurrent Behavior
it returns nothing
Reproduction Steps
Just deploy this for the first time
and then modify codeUri or events, run
cdk diff
again.Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
v2.126.0
Framework Version
No response
Node.js Version
v18.16.0
OS
mac
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: