Commit d229807
committed
fix(analyzer): order IGW/VPCGatewayAttachment delete after NatGateway
Destroying a VPC + NAT Gateway + IGW stack attempted the
VPCGatewayAttachment detach while the NAT Gateway's Elastic IP was still
mapped to the VPC's public address space, failing with "Network vpc-xxx
has some mapped public address(es)", after which the IGW delete hung
(~19 min observed). This was the first-run failure split out of the #804
incident as a separate issue.
Add two type-based implicit delete-dependency edges in
IMPLICIT_DELETE_DEPENDENCIES so the shared deploy DELETE phase and the
standalone destroy command order the teardown like CloudFormation does:
- AWS::EC2::InternetGateway now lists AWS::EC2::NatGateway (alongside its
existing AWS::EC2::VPCGatewayAttachment dependee)
- AWS::EC2::VPCGatewayAttachment (new key) lists AWS::EC2::NatGateway
Both are deleted AFTER the NAT Gateway is gone, since NAT deletion
releases/decouples the EIP. No type-based rule is needed for the EIP
itself: the NAT Ref's its EIP via AllocationId, so the reversed delete
traversal already deletes the NAT before the EIP is released. The
injection logic naturally produces no edge when no NatGateway is in
state.
Tests: 4 unit assertions in implicit-delete-deps.test.ts (IGW-after-NAT
edge, VPCGatewayAttachment-after-NAT edge, no NatGateway/EIP key
registered; the existing no-self-cycle guard covers the new entries).
The existing vpc-nat-gateway integ fixture (VPC + public/private subnets
+ IGW + NatGateway + EIP) exercises this teardown end-to-end.
Closes #8171 parent c870e49 commit d229807
4 files changed
Lines changed: 40 additions & 3 deletions
File tree
- .claude/rules
- docs
- src/analyzer
- tests/unit/analyzer
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
25 | 40 | | |
26 | 41 | | |
27 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
37 | 58 | | |
38 | 59 | | |
39 | 60 | | |
| |||
0 commit comments