-
-
Save dgwhited/64118a7c48fd0aaa33627e68bcef61ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
profile_name = 'dev' | |
role_name = 'test-role' | |
session = boto3.Session(profile_name=profile_name) | |
iam = session.client('iam') | |
def get_policies_for_role(rolename): | |
all_policies = {} | |
# two possible types of policies - inline and managed | |
inline_policies = iam.list_role_policies(RoleName=rolename)['PolicyNames'] | |
attached_policies = iam.list_attached_role_policies(RoleName=rolename)['AttachedPolicies'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment