Skip to content

Instantly share code, notes, and snippets.

@dploeger
Last active December 5, 2023 09:44
Show Gist options
  • Select an option

  • Save dploeger/fbeea791c256659985d09534fee4362a to your computer and use it in GitHub Desktop.

Select an option

Save dploeger/fbeea791c256659985d09534fee4362a to your computer and use it in GitHub Desktop.

Revisions

  1. Dennis Ploeger revised this gist Dec 5, 2023. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions getawspolicydocuments.fish
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    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)
    aws iam get-policy-version --policy-arn $POLICYARN --version-id $POLICYVERSION
    end
    end > work/policies
    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
  2. Dennis Ploeger created this gist Dec 5, 2023.
    5 changes: 5 additions & 0 deletions getawspolicydocuments.fish
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    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)
    aws iam get-policy-version --policy-arn $POLICYARN --version-id $POLICYVERSION
    end
    end > work/policies