Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> import boto3
- >>> account_id = boto3.resource('iam').CurrentUser().arn.split(':')[4]
- >>> timeit.timeit("boto3.resource('iam').CurrentUser().arn",
- ... 'import boto3', number=10)
- 4.8895583080002325
- >>> import boto3
- >>> boto3.client('sts').get_caller_identity().get('Account')
- '012345678901'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement