bug: EC2 deletes subnets and VPC still referenced by an active application load balancer #75
AndreKurait
started this conversation in
Bugs (AWS)
Replies: 1 comment
|
Hello Andre. Thanks for the detailed report. I escalated the issue to the engineering team to work on it. I will update you as soon as I can. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
An active application load balancer does not prevent deletion of either of its subnets. Once both subnets are deleted, its VPC can also be deleted, while
DescribeLoadBalancersstill returns the same active load balancer with the deleted subnet IDs.Reproduced on an isolated, unmodified
localstack/localstack-pro:devcontainer on Linux ARM64:2026.10.0.dev102.sha256:32adad290f38267baf073c8d519addfeee2dced2d9d68d3d28666cce88735bf7.sha256:c64ee0830b70bf09e2c58122b128e70ca44058a28d52caf1bcfa448f2fdf7ca5.ec2,elbv2,sts;EC2_VM_MANAGER=mock,EC2_DOWNLOAD_DEFAULT_IMAGES=0,EAGER_SERVICE_LOADING=1.Observed
DeleteSubnetreturns HTTP 200 for both subnets.DeleteVpcreturns HTTP 200.DescribeVpcsreturnsInvalidVpcID.NotFound, butDescribeLoadBalancersstill returns the active ALB referencing the deleted subnets.As controls, deleting an empty VPC succeeds, while deleting a VPC with an ordinary remaining subnet correctly returns
DependencyViolation. The missing dependency is exposed when deleting the subnets used by the ALB.Expected
Deleting a subnet still used by a load balancer should refuse with
DependencyViolation. Deleting the load balancer first should eventually release its subnet dependency. The VPC should remain protected while its subnets remain.AWS documents the network interfaces created for each enabled ALB zone and that requester-managed network interfaces are removed by deleting their owning service resource:
This report is based on a LocalStack runtime reproduction and the documented AWS resource dependency. I did not run the destructive sequence against an AWS account.
Reproduction
Run this against a disposable LocalStack instance listening on local port 4566. It deliberately attempts to delete the resources it creates. It uses only dummy local credentials.
Impact
Independent resource deletion can proceed before the load balancer is removed, leaving live service resources referencing deleted networking. This undermines dependency-based cleanup and retry ordering. The isolated reproduction establishes the API inconsistency; it does not establish a specific application's concurrency failure.
All reactions