Skip to content
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

(aws-ec2): (ec2.Instance should delete the Instance policies from the Instance role it builds out) #26594

Closed
2 tasks
arbeiterz opened this issue Aug 1, 2023 · 2 comments
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.

Comments

@arbeiterz
Copy link

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

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.89

Environment details (OS name and version, etc.)

Linux, CDK v2.89

@arbeiterz arbeiterz added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 1, 2023
@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Aug 1, 2023
@khushail khushail added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Aug 2, 2023
@khushail khushail self-assigned this Aug 2, 2023
@khushail
Copy link
Contributor

khushail commented Aug 3, 2023

@arbeiterz , It would also be helpful if you could share the code for understanding and replicating the issue.

@khushail khushail removed their assignment Aug 3, 2023
@khushail khushail added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-triage This issue or PR still needs to be triaged. labels Aug 3, 2023
@github-actions
Copy link

github-actions bot commented Aug 5, 2023

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

2 participants