-
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
Cannot get .resourceType, because the type was changed #13921
Comments
I think the issue is that your deployed stack and your new proposed template have a resource with the same logical ID, but a different Apparently our diff tool doesn't deal with that situation very well. |
Thanks for reporting @DmPanov . Yes, this is a flaw in the |
I'm facing the same problem described earlier by DmPanov. |
Is there a suggested workaround for this? I'm using When I copy the template (a yaml file using a serverless transform) I get this:
^^^ is this bug #16654 But then when I copy the processed json template I get this:
The type it is complaining about (after adding in some logs) being changed is:
UPDATE: Fixed this by doing |
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
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: * [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 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*
cdk diff
exits withCannot get .resourceType, because the type was changed
error message,cdk synth
works fine.Reproduction Steps
Cannot provide them, I still have no idea how I ended up in that state, sorry.
What did you expect to happen?
Diff should be shown or at least a clear error message with exact resource id, old and new types.
What actually happened?
Cannot get .resourceType, because the type was changed
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: