move comments around for pydocs functionality
This commit is contained in:
16
libs/sts.py
16
libs/sts.py
@@ -1,12 +1,12 @@
|
||||
'''
|
||||
STS libs for WeirdAAL
|
||||
'''
|
||||
|
||||
import boto3
|
||||
import botocore
|
||||
import pprint
|
||||
import sys
|
||||
|
||||
'''
|
||||
STS libs for WeirdAAL
|
||||
'''
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=5, width=80)
|
||||
|
||||
# from http://docs.aws.amazon.com/general/latest/gr/rande.html
|
||||
@@ -21,6 +21,10 @@ AWS_ACCESS_KEY_ID = credentials.access_key
|
||||
|
||||
|
||||
def sts_get_accountid():
|
||||
'''
|
||||
Use STS functions to get account data
|
||||
ex: Account Id: 14681234567
|
||||
'''
|
||||
try:
|
||||
client = boto3.client("sts")
|
||||
account_id = client.get_caller_identity()["Account"]
|
||||
@@ -40,6 +44,10 @@ def sts_get_accountid():
|
||||
|
||||
|
||||
def sts_get_accountid_all():
|
||||
'''
|
||||
Use STS functions to get account data (detailed)
|
||||
Prints AccountID, UserID, ARN
|
||||
'''
|
||||
try:
|
||||
client = boto3.client("sts")
|
||||
account_id = client.get_caller_identity()["Account"]
|
||||
|
||||
Reference in New Issue
Block a user