ECS cluster deletion failed and cannot clear resources for deletion

0

Hi. I was deleting an ECS cluster that I had previously created for testing, and the deletion failed while deleting the associated CloudFormation stack:

17:13:13 UTC-0400 DELETE_FAILED AWS::CloudFormation::Stack EC2ContainerService-default2 The following resource(s) failed to delete: InternetGateway, PubSubnetAz1, AttachGateway, Vpc, PubSubnetAz2.
17:13:12 UTC-0400 DELETE_FAILED AWS::EC2::VPC Vpc The vpc 'vpc-09e10addacef6e028' has dependencies and cannot be deleted. (Service: AmazonEC2; Status Code: 400; Error Code: DependencyViolation; Request ID: 195c6f6e-becf-4728-a7d6-f11d6573891a)
17:08:42 UTC-0400 DELETE_FAILED AWS::EC2::InternetGateway InternetGateway The internetGateway 'igw-08a1f6f2bd2a77c06' has dependencies and cannot be deleted. (Service: AmazonEC2; Status Code: 400; Error Code: DependencyViolation; Request ID: 84e26ddc-b815-449f-a575-4c5c39854164)
16:55:57 UTC-0400 DELETE_IN_PROGRESS AWS::EC2::VPC Vpc 16:55:55 UTC-0400 DELETE_FAILED AWS::EC2::Subnet PubSubnetAz1 The subnet 'subnet-01ecce398758db4c3' has dependencies and cannot be deleted. (Service: AmazonEC2; Status Code: 400; Error Code: DependencyViolation; Request ID: f0fd76eb-a336-4164-907f-e03219fb1447)
16:55:45 UTC-0400 DELETE_FAILED AWS::EC2::Subnet PubSubnetAz2 The subnet 'subnet-0d0e65ba8443ffc67' has dependencies and cannot be deleted. (Service: AmazonEC2; Status Code: 400; Error Code: DependencyViolation; Request ID: f11b051c-0425-412e-9732-2e38ac999d14)
16:52:31 UTC-0400 DELETE_IN_PROGRESS AWS::EC2::InternetGateway InternetGateway 16:52:29 UTC-0400 DELETE_FAILED AWS::EC2::VPCGatewayAttachment AttachGateway Network vpc-09e10addacef6e028 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: 9bf19a10-6e73-477b-a250-c111abe7b39a)
16:38:21 UTC-0400 DELETE_COMPLETE AWS::EC2::SecurityGroup EcsSecurityGroup 16:38:20 UTC-0400 DELETE_IN_PROGRESS AWS::EC2::SecurityGroup EcsSecurityGroup 16:38:19 UTC-0400 DELETE_COMPLETE AWS::AutoScaling::LaunchConfiguration EcsInstanceLc 16:38:18 UTC-0400 DELETE_IN_PROGRESS AWS::AutoScaling::LaunchConfiguration EcsInstanceLc 16:38:14 UTC-0400 DELETE_IN_PROGRESS AWS::EC2::Subnet PubSubnetAz1 16:38:14 UTC-0400 DELETE_IN_PROGRESS AWS::EC2::Subnet PubSubnetAz2 16:38:13 UTC-0400 DELETE_COMPLETE AWS::AutoScaling::AutoScalingGroup EcsInstanceAsg 16:36:43 UTC-0400 DELETE_COMPLETE AWS::EC2::RouteTable RouteViaIgw 16:36:42 UTC-0400 DELETE_IN_PROGRESS AWS::EC2::RouteTable RouteViaIgw 16:36:42 UTC-0400 DELETE_IN_PROGRESS AWS::EC2::VPCGatewayAttachment AttachGateway 16:36:41 UTC-0400 DELETE_COMPLETE AWS::EC2::SubnetRouteTableAssociation PubSubnet1RouteTableAssociation 16:36:41 UTC-0400 DELETE_COMPLETE AWS::EC2::Route PublicRouteViaIgw 16:36:40 UTC-0400 DELETE_COMPLETE AWS::EC2::SubnetRouteTableAssociation PubSubnet2RouteTableAssociation 16:36:25 UTC-0400 DELETE_IN_PROGRESS AWS::AutoScaling::AutoScalingGroup EcsInstanceAsg 16:36:25 UTC-0400 DELETE_IN_PROGRESS AWS::EC2::SubnetRouteTableAssociation PubSubnet1RouteTableAssociation 16:36:25 UTC-0400 DELETE_IN_PROGRESS AWS::EC2::Route PublicRouteViaIgw 16:36:25 UTC-0400 DELETE_IN_PROGRESS AWS::EC2::SubnetRouteTableAssociation PubSubnet2RouteTableAssociation 16:36:23 UTC-0400 DELETE_IN_PROGRESS AWS::CloudFormation::Stack EC2ContainerService-default2 User Initiated

When trying to then manually detach the ENI in question, it says:

An error occurred (AuthFailure) when calling the DetachNetworkInterface operation: You do not have permission to access the specified resource.

This was an ENI auto-created as part of the ECS wizard I ran. I am in the Administrators group. I re-ran the cluster delete, and it still fails.

What do I need to do to get rid of this ECS cluster?

Edited by: MushyMiddle on Apr 25, 2019 2:58 PM

asked 5 years ago511 views
1 Answer
0

I was finally able to delete the cluster by manually deleting the IGW, VPC, etc.

ECS cluster deletion seems to be very broken.

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