Skip to content

Instantly share code, notes, and snippets.

@greencamp20552
Created July 10, 2023 09:40
Show Gist options
  • Select an option

  • Save greencamp20552/4afeb4c412eeb27e058d6370513cdf57 to your computer and use it in GitHub Desktop.

Select an option

Save greencamp20552/4afeb4c412eeb27e058d6370513cdf57 to your computer and use it in GitHub Desktop.
aws-architect-professional
def list_policies():
iam = boto3.client("iam")
paginator = iam.get_paginator('list_policies')
for response in paginator.paginate(Scope="AWS"):
for policy in response["Policies"]:
print(f"Policy Name: {policy['PolicyName']} ARN: {policy['Arn']}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment