devwannabe
devwannabe

Reputation: 3210

Displaying names of attached policies to an IAM role using Boto3

I'm having a hard time trying to figure out which method to use from the IAM Boto3 documentation. I already have a code that gets all the Local policies using

response = client.list_policies(
  Scope='Local',
  OnlyAttached=True
)

But the code I need is to display the name of the attached policy to a role. I can't figure out which one from this document - https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/iam.html

Upvotes: 0

Views: 163

Answers (1)

devwannabe
devwannabe

Reputation: 3210

I got it working

response = client.list_attached_role_policies(
  RoleName='MyRoleName'
)

Upvotes: 1

Related Questions