Created
July 7, 2022 19:07
-
-
Save weyderfs/9f42e5a207293aa3578506e7417236b5 to your computer and use it in GitHub Desktop.
List and Delete all customer managed AWS IAM Policies
This file contains hidden or 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
#!/bin/sh | |
customer_managed_policy_arns=`aws iam list-policies --scope Local --query 'Policies[*].Arn' --output text` | |
for arn in $customer_managed_policy_arns; do | |
echo aws iam delete-policy --policy-arn "$arn" #To delete re-run without "echo" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment