7 lines
303 B
Bash
7 lines
303 B
Bash
|
aws iam list-policies --scope Local | jq -cr '.Policies[].Arn' | while read i; do
|
||
|
VER=$(aws iam get-policy --policy-arn $i | jq -cr .Policy.DefaultVersionId)
|
||
|
POLNAME=$(echo $i | awk -F/ '{print $NF}')
|
||
|
aws iam get-policy-version --policy-arn $i --version-id $VER > iam-policies/$POLNAME.json
|
||
|
done
|
||
|
|