Created
March 11, 2024 09:57
-
-
Save paulmwatson/fc7adb67b5da2b5bb64ceeb98810dae7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python to return the IAM details of an access key | |
import boto3 | |
client = boto3.client('sts', aws_access_key_id="ACCESS_KEY_ID", aws_secret_access_key="SECRET") | |
client.get_caller_identity() | |
=> {'UserId': '...', 'Account': '...', 'Arn': 'arn:aws:iam::...:user/...', 'ResponseMetadata': {'RequestId': '...', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '...', 'content-type': 'text/xml', 'content-length': '409', 'date': '...'}, 'RetryAttempts': 0}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment