cfn_delete consistently fails #177
Comments
Though I mostly get this error, once in a while (say 1 out of 5, perhaps a little less often) I've had a stack successfully delete. I suspect this is related to the speed of some operations, and on the occasions a stack has deleted, it's been because an ordinarily slow operation has completed before the depending VPC deleted. The core work of the cfn_delete task is a single call (source file
Once the fix is in place, we'll still have this issue on stacks which have been created in the period between after the problematic VPC was added[1] and before that problematic VPC had its dependency added. But future stacks will be deletable without problem. [1] Identifying this VPC is the crux of this issue |
Our AWS Solutions Architect provided the following input:
|
Some cloudformation resources depend on other resources before they can be created or deleted. This especially causes problems when deleting VPC's, meaning that the delete fails since there are dependent resources still in the process of being removed form the VPC. By adding the DependsOn attribute to these resources, this problem can be resolved. This change uses the AWS guidance on when this is required to add this attribute to resources that do, or may require it. The details are in the link below. http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html#gatewayattachment Following the advice in the document above, the resources below are considered, Already has DependsOn the VPCGatewayAttachment * Amazon VPC routes that include the Internet gateway Added DependsOn the VPCGatewayAttachment since EC2 instances have public ips * Auto Scaling groups * Elastic Load Balancers Added DependsOn the VPCGatewayAttachment since they can have public ips * RDS instances No action required * Elastic IP addresses - we dont have any yet * Amazon EC2 instances - these are handled by the ASG (Closes #177)
fixed by #214 |
CF output:
11:54:19 UTC+0000 DELETE_FAILED AWS::EC2::VPCGatewayAttachment AttachGateway Network vpc-69a8810c has some mapped public address(es). Please unmap those public address(es) before detaching the gateway.
pip freeze tells me:
bootstrap-cfn==0.7.5
If I manually find the IGW and detach it, then I can delete the stack.
The text was updated successfully, but these errors were encountered: