AWS Certified Developer – Associate (DVA-C02) — Question 361
A developer received the following error message during an AWS CloudFormation deployment:
DELETE_FAILED (The following resource(s) failed to delete: [ASGInstanceRole12345678].)
Which action should the developer take to resolve this error?
Answer options
- A. Contact AWS Support to report an issue with the Auto Scaling Groups (ASG) service.
- B. Add a DependsOn attribute to the ASGInstanceRole12345678 resource in the CloudFormation template. Then delete the stack.
- C. Modify the CloudFormation template to retain the ASGInstanceRole12345678 resource. Then manually delete the resource after deployment.
- D. Add a force parameter when calling CloudFormation with the role-arn of ASGInstanceRole12345678.
Correct answer: C
Explanation
When a resource fails to delete and blocks stack deletion, the standard resolution is to instruct CloudFormation to retain the failed resource so the stack can delete successfully, followed by manual cleanup of that resource. Adding a DependsOn attribute does not resolve an active deletion failure, and contacting AWS Support is unnecessary for this standard operational issue. Furthermore, CloudFormation does not support a force parameter with a role-arn to bypass deletion errors.