Skip to content

Instantly share code, notes, and snippets.

@dploeger
Last active December 5, 2023 09:44
Show Gist options
  • Save dploeger/fbeea791c256659985d09534fee4362a to your computer and use it in GitHub Desktop.
Save dploeger/fbeea791c256659985d09534fee4362a to your computer and use it in GitHub Desktop.
Get all customer managed AWS policy documents (in Fish)
for POLICYARN in (aws iam list-policies --scope Local | jq -r .Policies[].Arn)
for POLICYVERSION in (aws iam list-policy-versions --policy-arn $POLICYARN | jq -r .Versions[].VersionId)
echo $POLICYARN/$POLICYVERSION
aws iam get-policy-version --policy-arn $POLICYARN --version-id $POLICYVERSION
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment