Last active
December 5, 2023 13:29
-
-
Save andresriancho/f257ba10fee340243cfa3a775aa3eaba to your computer and use it in GitHub Desktop.
Get AWS root account email address
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
import boto3 | |
session = boto3.Session(profile_name='ariancho') | |
s3_client = session.client('s3') | |
display_name = s3_client.list_buckets()['Owner']['DisplayName'] | |
print(display_name) | |
for bucket in s3_client.list_buckets()['Buckets']: | |
print(s3_client.get_bucket_acl(Bucket=bucket['Name'])['Owner']['DisplayName']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Much appreciated guys for the provided answers. Exactly what i was looking for