Skip to content

Instantly share code, notes, and snippets.

View zingroo's full-sized avatar
🎯
Focusing

Ajinkya Dharmapurikar zingroo

🎯
Focusing
View GitHub Profile
@zingroo
zingroo / sts_assume_role.py
Created October 17, 2019 13:58
sts_Assume_role
def assume_full_access_role(accountid, user):
"""
start assume session role with full access profile for the provided account ID with user
"""
print("Creating custom Assumerole Session")
boto_session_original = boto3.Session(
profile_name="identity", region_name="<default region name>"
)
mfa_1 = input("Enter MFA Code: ")
sts_connection = boto_session_original.client("sts")