A developer is deploying a containerized application to Amazon ECS using the AWS Fargate launch type. The application code needs to read objects from an Amazon S3 bucket.
Which of the following IAM configurations is required to allow the application code to access the S3 bucket?
- Configure an IAM role with Amazon S3 read permissions and assign it as the Task Role (taskRoleArn) in the ECS task definition.Cevap
- BConfigure an IAM role with Amazon S3 read permissions and assign it as the Task Execution Role (executionRoleArn) in the ECS task definition.
- CHardcode AWS access keys and secret access keys with S3 read permissions directly in the application code inside the Docker container.
- DConfigure an IAM role with Amazon S3 read permissions, but set the trust policy principal to allow the Amazon EC2 service (ec2.amazonaws.com) to assume the role.
Cevap
Configure an IAM role with Amazon S3 read permissions and assign it as the Task Role (taskRoleArn) in the ECS task definition.
Configuring an IAM role with Amazon S3 read permissions and assigning it as the Task Role (taskRoleArn) in the ECS task definition is correct. The Task Role is designed to grant application code running inside the ECS container permissions to call AWS APIs.
Adım Adım Çözüm
Anahtar Kavram
Distinction between ECS Task Role and Task Execution Role