Resource deletion failures in a stack
Stack deletion usually fails because a resource within the stack cannot be deleted. This topic provides solutions for common resource deletion failures.
Existing resource associations
Example: A security group fails to delete with the error code DependencyViolation and the error message "There is still instance(s) in the specified security group". The security group is still associated with an instance, which prevents deletion.
Solution: Log on to the ECS console, find the security group, and click Details to view its information. You can also navigate to the resource details page by using the resource ID shown in the deletion failure message. Then, unbind the security group.
Resource not found in console
Example: The error message "The specified ** is not found. Code: **.NotFound" is reported. Resource Orchestration Service (ROS) cannot find the specified resource, which prevents deletion.
Solution: Retain the resource when you delete the stack. In the Delete Stack dialog box, set the deletion method to Retain Resource. In the Resources drop-down list, select the resource to retain and click OK.
Insufficient permissions
Example: The NoPermission error indicates that the RAM user does not have the required permissions, such as config:ListPreManagedRules. When this occurs, the No Permission dialog box appears. To identify the missing permission, expand Error Details and check the AuthAction field, for example, config:ListPreManagedRules.
Solution: Grant the required permissions to the RAM user.