diff --git a/awsrequests/__init__.py b/awsrequests/__init__.py index 1ea3ce6..d9f2d63 100644 --- a/awsrequests/__init__.py +++ b/awsrequests/__init__.py @@ -49,7 +49,7 @@ def __init__(self, region, access_key=None, secret_key=None, session_token=None, else: raise EnvironmentError("could not find AWS creds (don't have boto3, so didn't look anywhere fancy)") - def assume_role(self, role_arn): + def assume_role(self, role_arn, role_session_name="AwsBootstrapper", **kwargs): sts_client = boto3.client('sts', region_name=self.region, aws_access_key_id=self.access_key, @@ -57,7 +57,8 @@ def assume_role(self, role_arn): try: temp_security_creds = sts_client.assume_role(RoleArn=role_arn, - RoleSessionName="AwsBootstrapper" + RoleSessionName=role_session_name, + **kwargs ) self.access_key = temp_security_creds["Credentials"]["AccessKeyId"] self.secret_key = temp_security_creds["Credentials"]["SecretAccessKey"] diff --git a/setup.py b/setup.py index 9918340..3aa2ba9 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( name='awsrequests', - version='0.0.11', + version='0.0.11+dtr.1', packages=['awsrequests'], url='https://github.com/djcrabhat/aws-requests', license='MIT License',