When I launch an EC2 instance with an IAM role I can use boto3
on that EC2instance and not have to specify aws access and secret keys because boto3
reads them automatically.
>>> import boto3
>>> s3 = boto3.resource("s3")
>>> list(s3.buckets.all())[0]
s3.Bucket(name='my-bucket-name')
Question
I'm wondering if there is any way to get the access key and secret key from boto3? For example, how can I print them on to the standard console using print
There sure is (docs):