Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
alternative for assuming the role
Browse files Browse the repository at this point in the history
  • Loading branch information
esc committed Nov 19, 2015
1 parent f8275bb commit 610de93
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/integrationtest/python/assume_role.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#!/usr/bin/env python

import boto3
#import boto3
import os
import sys
import json


def assume_role():
invoker_role_arn = os.environ["INVOKER_ROLE_ARN"]
sts_client = boto3.client('sts')
return sts_client.assume_role(
RoleArn=invoker_role_arn,
RoleSessionName='integration_test')['Credentials']
#def assume_role():
# invoker_role_arn = os.environ["INVOKER_ROLE_ARN"]
# sts_client = boto3.client('sts')
# return sts_client.assume_role(
# RoleArn=invoker_role_arn,
# RoleSessionName='integration_test')['Credentials']


def format_(credentials):
Expand All @@ -22,4 +24,4 @@ def format_(credentials):


if __name__ == "__main__":
format_(assume_role())
format_(json.loads(sys.stdin.read())['Credentials'])

0 comments on commit 610de93

Please sign in to comment.