-
Notifications
You must be signed in to change notification settings - Fork 13
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
Toolkit: IoHost I5502 events are missing metadata while removing resources during deploy
#203
Comments
Issue Summary:
The issue appears to be that when resources are being deleted during a deploy operation, the stack manifest being used doesn't contain metadata for those resources anymore, since they have been removed from the new stack definition. However, during a destroy operation, we still have access to the original stack manifest with all the metadata. Suggested Fix: We should preserve the metadata from the previous stack deployment when handling deletion events. |
That's almost right. The reason we don't have the metadata during "resource removal" is because your cloud assembly doesn't contain that resource anymore - therefore there is no construct path (and other metadata to be presented). This can also happen during a destroy action, if the resource construct was removed between the inital deploy and the destroy. It might be easier to understand this by imagining this scenario:
|
Note this issue isn't exclusive to |
I've got a potential workaround for top-level stacks. For nested stacks, this is proving to be very tricky. |
By design, a Cloud Assembly represents a current point in time and previous states are not available. It's something that comes up frequently, but it's not a trivial thing to build and if we would do this, it would be for other features with this issue just being a happy bystander. The workaround would have been to query the previously deployed template from CloudFormation and look for CDK Path Metadata. However this is not guaranteed to work, since Metadata is optional. Also this would only cover We cannot use the workaround for nested stacks since additional permissions would be required. We could add them to the deploy role, but that makes it a much bigger task and would also not be resolved soon. With all this in mind, we are not currently looking at implementing this. Also reclassified as a feature request since this works as designed. |
Describe the bug
During a
deploy
action, if you remove resources, the IoHost events generated for CFN deployment progress (I5502 code) are missing the metadata fields. Creating new resources ortoolkit.destroy
have the metadata fields.Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
metadata should be included for all events, we rely on the constructPath for building and showing the hierarchy and friendly names.
Current Behavior
metadata is missing only for deleted resources during a deploy action
Reproduction Steps
Deploy this app
Dependencies
Execute it like
npx tsx main.ts
and observe the following outputConsole logs generated
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
0.1.4
Framework Version
No response
Node.js Version
20.18.1
OS
arm64
Language
TypeScript
Language Version
5
Other information
No response
The text was updated successfully, but these errors were encountered: