(aws-ec2): (ec2.Instance should delete the Instance policies from the Instance role it builds out) #26594
Labels
@aws-cdk/aws-ec2
Related to Amazon Elastic Compute Cloud
closed-for-staleness
This issue was automatically closed because it hadn't received any attention in a while.
feature-request
A feature should be added or improved.
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Describe the feature
On attempting to perform a "cdk destroy" against a stack which deployed an instance with ec2.Instance, CDK refuses to destroy it and complains about the fact that the policies must first be removed from the role. With this feature in place, CDK would recognize that CDK itself had built the role and take steps to remove the policies and delete the role along with the instance.
Use Case
I would like to be able to simply call, "cdk destroy" against a stack that deployed an EC2 instance with ec2.Instance() and have the instance destroyed without having to do manual clean up. This is why I want to use CDK to begin with - so I don't have go manually cleaning up a bunch of stuff.
Proposed Solution
Have CDK recognize the fact that ec2.Instance is contained in the stack and therefore it should expect to have to clean up the role properly on instance deletion.
Other Information
No response
Acknowledgements
CDK version used
2.89
Environment details (OS name and version, etc.)
Linux, CDK v2.89
The text was updated successfully, but these errors were encountered: