How to get current AWS STS/IAM identity using boto3

import boto3

# Create STS client
sts = boto3.client('sts')

# Call STS to get details on current identity
response = sts.get_caller_identity()

# Print the response
print(response)
10 lines of code, 181 characters

Similar AWS code snippets using python

Finally, a good search for AWS Console

Was that in us-east-1? Or us-west-2? No need to remember. Just type the name of the resource and CloudTempo will find it.

Feature