From d7ae9e8c1a17a043f9dfb4a76c977662fd170126 Mon Sep 17 00:00:00 2001 From: carnal0wnage Date: Fri, 30 Jun 2017 17:20:26 -0400 Subject: [PATCH] sts update --- libs/sts.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libs/sts.py b/libs/sts.py index 94e09ef..3660c6e 100644 --- a/libs/sts.py +++ b/libs/sts.py @@ -7,15 +7,11 @@ pp = pprint.PrettyPrinter(indent=5, width=80) #from http://docs.aws.amazon.com/general/latest/gr/rande.html regions = ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', ] - -AWS_ACCESS_KEY_ID = '' -AWS_SECRET_ACCESS_KEY = '' - - def get_accountid(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY): try: client = boto3.client("sts", aws_access_key_id=AWS_ACCESS_KEY_ID, aws_secret_access_key=AWS_SECRET_ACCESS_KEY) account_id = client.get_caller_identity()["Account"] + print account_id except KeyboardInterrupt: print("CTRL-C received, exiting...") return account_id \ No newline at end of file