简体   繁体   中英

Running python boto3 inside a docker container requirements on AWS

So, I'm using boto3 s3 with a python script just to list the bucket.

s3_client = boto3.client('s3')

It works fine when I run it on my desktop because I setup the aws_access_key_id and aws_secret_access_key with my aws configure command.

When I run it on AWS as a container, am I going to need to run my container with environmental variables for the aws_access_key_id and aws_secret_access_key when I use boto3 or if I have my setup for my container user having access to s3, will that work and I don't need to use the keys?

would I still need to setup the aws key and secret key in boto3 or will it work off the permissions I give to my task execute user

You don't have to hard code anything. Instead you provide the permissions using IAM Roles for Tasks . So S3 permissions are granted through this role. Boto3 will automatically inherit the permissions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM