Created
January 14, 2022 08:38
-
-
Save sivaramsajeev/9d47d8b89c2a818e296f825b5bd1155f to your computer and use it in GitHub Desktop.
Unable to delete cfn stack, role is invalid or cannot be assumed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason you get this error is because you probably deleted a CloudFormation stack that has an IAM role | |
that's being used by the stack you're trying to delete. | |
Follow the steps below to get rid of the mess | |
================================================================= | |
1) Create a new role (eg: myStackDeleterRole). Key is to attach `CloudFormation` as the service that assumes this role | |
2) Attach the required Policy. (You could play around here till finding the right set of permissions OR attach AdministratorAccess straight away) | |
3) Run the below command from CLI | |
```aws cloudformation delete-stack --role-arn arn:aws:iam::<account>:role/myStackDeleterRole --stack-name <theStuckStack>``` | |
4) After you delete the CloudFormation stack, you can delete the IAM role you just created OR keep it for the next mess | |
https://aws.amazon.com/premiumsupport/knowledge-center/cloudformation-stack-delete-failed/ | |
https://stackoverflow.com/questions/48709423/unable-to-delete-cfn-stack-role-is-invalid-or-cannot-be-assumed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks a lot !!! It Works