File
Write to your ~/.aws/credentials file
weep file test_account_user --profile defaultcat ~/.aws/credentials[default]
aws_access_key_id = ASIA4JEFLERSJZDM7YOH
aws_secret_access_key = .....
aws_session_token = .....AWS_PROFILE=test_account_user aws sts get-caller-identity
# you can also use the --profile flag
aws --profile test_account_user sts get-caller-identityimport boto3
session = boto3.Session(profile_name="test_account_user")
client = session.client("sts")
print(client.get_caller_identity())Last updated