-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
EC2: Raise when deleting VPCs with dependent Subnets #8811
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
Conversation
| "VPC": { | ||
| "Type": "AWS::EC2::VPC", | ||
| "Properties": {"CidrBlock": "10.0.0.0/16"}, | ||
| }, |
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.
Moto Cfn evaluates deletion in sequence, so now, attempting to delete VPCs before subnets raises.
It's not clear to me where/if Moto figures out the right order of resource manipulation, or how much additional work is required.
This is a quick workaround to make the test pass in the interim.
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 is arguably a bug in Moto - we figure out the right order when updating CF resources, but not yet when deleting them. I'll raise a separate PR to fix this.
b680795 to
a2e32d1
Compare
a2e32d1 to
4f2d4f0
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8811 +/- ##
==========================================
+ Coverage 92.80% 92.82% +0.01%
==========================================
Files 1261 1266 +5
Lines 109888 110464 +576
==========================================
+ Hits 101986 102536 +550
- Misses 7902 7928 +26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bblommers
left a comment
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.
Thanks @viren-nadkarni!
AWS does not allow deleting VPCs that have subnets associated with it. This PR adds this behaviour to Moto.