Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@rate_limited()
@sts_conn('iam', service_type='client')
def get_role_inline_policy_names(role, client=None, **kwargs):
marker = {}
inline_policies = []
while True:
response = client.list_role_policies(
RoleName=role['RoleName'],
**marker
)
inline_policies.extend(response['PolicyNames'])
if response['IsTruncated']:
marker['Marker'] = response['Marker']
else:
return inline_policies
@rate_limited()
def list_attached_group_managed_policies(group_name, client=None, **kwargs):
"""Lists the attached IAM managed policies for a given IAM group."""
return client.list_attached_group_policies(GroupName=group_name, **kwargs)
@rate_limited()
def describe_instances(**kwargs):
return kwargs.pop('client').get_paginator('describe_instances').paginate()
@rate_limited()
def get_bucket_location(client=None, **kwargs):
"""
Bucket='string'
"""
return client.get_bucket_location(**kwargs)
@rate_limited()
def purge_queue(client=None, **kwargs):
return client.purge_queue(**kwargs)
@rate_limited()
def get_endpoint_attributes(client=None, **kwargs):
return client.get_endpoint_attributes(**kwargs)['Attributes']
@rate_limited()
def describe_vpc_classic_link_dns_support(**kwargs):
return kwargs.pop('client').describe_vpc_classic_link_dns_support(**kwargs)
@rate_limited()
def describe_images(**kwargs):
return kwargs.pop('client').describe_images(**kwargs)['Images']
@rate_limited()
def get_account_authorization_details(filter=None, client=None, **kwargs):
possible_filters = ['User', 'Role', 'Group', 'LocalManagedPolicy', 'AWSManagedPolicy']
if filter not in possible_filters:
raise InvalidAuthorizationFilterException('Must provide filter value: {}'.format(', '.join(possible_filters)))
if filter == 'User':
return _get_account_authorization_user_details(client=client, **kwargs)
elif filter == 'Role':
return _get_account_authorization_role_details(client=client, **kwargs)
elif filter == 'Group':
return _get_account_authorization_group_details(client=client, **kwargs)
elif filter == 'LocalManagedPolicy':
return _get_account_authorization_local_managed_policies_details(client=client, **kwargs)
elif filter == 'AWSManagedPolicy':
return _get_account_authorization_aws_managed_policies_details(client=client, **kwargs)
@rate_limited()
def get_bucket_website(client=None, **kwargs):
"""
Bucket='string'
"""
return client.get_bucket_website(**kwargs)