From 5a6b77c9b0da82c1f901408179df61f48ecfda35 Mon Sep 17 00:00:00 2001 From: Jim Patterson Date: Thu, 17 Aug 2017 16:19:19 -0400 Subject: [PATCH 1/2] Allow passthru args for assume_role This change allows for passthru args on the call to assume_role for things like ExternalId. --- awsrequests/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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"] From 0f78059122e1689c41fc80e98e221588d3590146 Mon Sep 17 00:00:00 2001 From: Jim Patterson Date: Thu, 17 Aug 2017 16:30:30 -0400 Subject: [PATCH 2/2] Build with local version until upstream merges --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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',