Created
August 21, 2019 14:51
-
-
Save joekiller/61c5706e346d98e9b656c3fc974165da to your computer and use it in GitHub Desktop.
Nuke iam start-pipeline policies
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
for p in $(aws iam list-policies --query 'Policies[?starts_with(PolicyName, `start-pipeline`) == `true`].Arn' --output text); do | |
for v in $(aws iam list-policy-versions --policy-arn $p --query 'Versions[?IsDefaultVersion == `false`].VersionId' --output text); do | |
aws iam delete-policy-version --policy-arn $p --version-id $v | |
done | |
aws iam delete-policy --policy-arn $p | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment