A web application is deployed as a Docker container on Amazon ECS using the AWS Fargate launch type. The application's Go code utilizes the AWS SDK to retrieve configuration files from an Amazon S3 bucket. Which IAM role must be configured with Amazon S3 read permissions to allow the application code to access the bucket?
- The ECS Task RoleAnswer
- BThe ECS Task Execution Role
- CAn IAM Role with a trust policy configured for Amazon EC2
- DAn IAM User with access keys passed into the container as environment variables
Answer
The ECS Task Role
The ECS Task Role is the IAM role assumed by the container itself. AWS SDKs running inside the container retrieve credentials from this role automatically, allowing the application code to interact with AWS services like Amazon S3.
Step-by-Step Solution
Key Concept
ECS Task Role vs Task Execution Role
Estimated Time:45s