-
Notifications
You must be signed in to change notification settings - Fork 3.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(cfn-diff): allow resources to change types #19891
Conversation
When writing the cloudformation-diff module, it was assumed that resources would never change their CloudFormation types between deployments. As it turns out, there is a legitimate case for resources changing types, and that's when you migrate from a template that uses Transforms (like the Serverless Transform) to one that doesn't use them. Because of that, handle the case of resources changing types in diff. Fixes aws#13921
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.
This needs to be interpreted as a replacement, no?
Yes, this is already handled by aws-cdk/packages/@aws-cdk/cloudformation-diff/lib/diff/types.ts Lines 155 to 157 in 186dc32
This is how the experience looks like in the CDK CLI: $ yarn cdk diff
...
Resources
[+] AWS::IAM::Role S1/Template/LambdaSaverRole LambdaSaverRole
[+] AWS::ApiGateway::Deployment S1/Template/SaveApiDeployment14a59e22ee SaveApiDeployment14a59e22ee
[+] AWS::ApiGateway::Stage S1/Template/SaveApiprodStage SaveApiprodStage
[+] AWS::Lambda::Permission S1/Template/LambdaSaverSaveApiPermissionprod LambdaSaverSaveApiPermissionprod
[~] AWS::Lambda::Function S1/Template/LambdaSaver LambdaSaver replace
[~] AWS::ApiGateway::RestApi S1/Template/SaveApi SaveApi replace |
Damn that sounds weird |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
I think that's because you can't really handle the replacement of an entire resource on the level of the property change, so that's why you can't do it from |
When writing the cloudformation-diff module, it was assumed that resources would never change their CloudFormation types between deployments. As it turns out, there is a legitimate case for resources changing types, and that's when you migrate from a template that uses Transforms (like the Serverless Transform) to one that doesn't use them. Because of that, handle the case of resources changing types in diff. Fixes aws#13921 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
When writing the cloudformation-diff module,
it was assumed that resources would never change their CloudFormation types between deployments.
As it turns out, there is a legitimate case for resources changing types,
and that's when you migrate from a template that uses Transforms
(like the Serverless Transform) to one that doesn't use them.
Because of that, handle the case of resources changing types in diff.
Fixes #13921
All Submissions:
Adding new Unconventional Dependencies:
New Features
yarn integ
to deploy the infrastructure and generate the snapshot (i.e.yarn integ
without--dry-run
)?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license