By using AWS re:Post, you agree to the AWS re:Post Terms of Use

CloudFormation Delete Stack Failing

0

I completed the Mythical Mysfits tutorial and am trying to delete everything and am getting a failure when I try to delete the MythicalMysfitsCoreStack for five resources (InternetGateway, PublicSubnetTwo, VPC, GatewayAttachement, PublicSubnetOne).

I suspect initially I deleted some things individually from the VPC or EC2 pages before trying through the CloudFormation page and that may be what is causing the problem.

Any help would be appreciated.

Thanks


I get the following errors when I try to delete via the AWS console.

  1. Delete VPC (vpc-0fac336b2f059ec69) gives the following error: The VPC contains one or more in-use network interfaces, and cannot be deleted until those network interfaces have been deleted. View in-use network interfaces in the VPC. eni-0a9df062d49c3dec2 eni-07d10b3c3b852ce70

  2. Delete Subnet (subnet-0206d2073c87a04f3) gives the following error: Note that the following subnets cannot be deleted:
    The following subnets contain one or more network interfaces, and cannot be deleted until those network interfaces have been deleted. Click here to view your network interfaces. subnet-0206d2073c87a04f3

  3. Detach Network Interface (eni-0a9df062d49c3dec2) gives the following error: Error detaching network interface eni-0a9df062d49c3dec2: You are not allowed to manage 'ela-attach' attachments.

Below is the output from the Delete Stack attempt from the CloudFormation page.

Logical ID: GatewayAttachement Physicial ID: Mythi-Gatew-1OYGS4QJHAZKU Type: AWS::EC2::VPCGatewayAttachment Status: DELETE_FAILED Status Reason: Network vpc-0fac336b2f059ec69 has some mapped public address(es). Please unmap those public address(es) before detaching the gateway. (Service: AmazonEC2; Status Code: 400; Error Code: DependencyViolation; Request ID: 8a6f95a2-e228-4248-8cfc-e9795dc0f4ac)

The other four all have the same "dependencies cannot be deleted" reason:

Logical ID: InternetGateway Physical ID: igw-073adf8f593324462 Type: AWS::EC2::InternetGateway Status: DELETE_FAILED Reason: The internetGateway 'igw-073adf8f593324462' has dependencies and cannot be deleted. (Service: AmazonEC2; Status Code: 400; Error Code: DependencyViolation; Request ID: f96f89cd-2307-4cbf-91cb-8283b3568720)

Logical ID: PublicSubnetOne Physical ID: subnet-0206d2073c87a04f3 Type: AWS: EC2::Subnet Status: DELETE_FAILED Reason: The subnet 'subnet-0206d2073c87a04f3' has dependencies and cannot be deleted. (Service: AmazonEC2; Status Code: 400; Error Code: DependencyViolation; Request ID: b6986282-6d4f-414c-9eb3-92861c88cc64)

Logical ID: PublicSubnetTwo Physical ID: subnet-07621c0034b1e8af7 Type: AWS::EC2::Subnet Status: DELETE_FAILED Reason: The subnet 'subnet-07621c0034b1e8af7' has dependencies and cannot be deleted. (Service: AmazonEC2; Status Code: 400; Error Code: DependencyViolation; Request ID: 321b0cc8-e4a2-40c9-85ca-2afef32020ba)

Logical ID: VPC Physical ID: vpc-0fac336b2f059ec69 Type: AWS::EC2::VPC Status: DELETE_FAILED Reason: The vpc 'vpc-0fac336b2f059ec69' has dependencies and cannot be deleted. (Service: AmazonEC2; Status Code: 400; Error Code: DependencyViolation; Request ID: a03aeb29-46c8-49b4-b1f1-0bc769b4be3c)

asked 5 years ago1.8K views
4 Answers
1
Accepted Answer

Seems like some resource is still using IP Addresses within your VPC. You can find these using the Network Interfaces tab of the EC2 Management Console. Once you find the ENI's attached to that VPC, you can find the individual resources. Specifically, take a look at whatever is connected to eni-0a9df062d49c3dec2

It could be any number of things, including Instances, NAT Gateways, VPC Endpoints, or other resources.

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#delete_eni

answered 5 years ago
1

It was a Load Balancer. Thanks.

answered 5 years ago
0

Hi,
Not sure this will help, but try going to Services->ECS and delete the created cluster (if there is one). That will often release Resources that will allow you to delete other things.
-randy

EXPERT
answered 5 years ago
0

Hi vasqued2,

I am glad to hear that you were able to solve the issue. Please let us know if you need any further help.

Regards,
awstomas

AWS
answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions