简体   繁体   中英

How to access other AWS services from inside a AWS ECS container on a EC2 host?

From AWS documentations, a program running in AWS EC2 instance created with the correct IAM role could use AWS SDK to get temporary aws_access_key_id and aws_secret_access_key for accessing desired aws resources. Does that apply for programs running inside a docker container in that instance? In my case, the container is started via AWS ECS and the program inside the container needs to access s3.

If that is not general practice, what is the proper way of accessing a file stored in s3 from inside a container?

Yes, Program running inside ECS can access s3 similarly to a program running inside Ec2 server. You need to set up proper IAM roles while launching ECS.

See this link Amazon ECS IAM Role guide for developers

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