A developer is deploying a containerized API application to Amazon ECS on AWS Fargate. The container needs to send its application logs to Amazon CloudWatch Logs using the awslogs log driver. Additionally, the application code itself needs to store uploaded user profile images in an Amazon S3 bucket. How should the developer configure the IAM roles in the task definition to satisfy these requirements?
- AAssociate an IAM role containing both Amazon S3 write and CloudWatch Logs write permissions as the Task Execution Role, and omit the Task Role.
- BAssociate an IAM role with CloudWatch Logs write permissions as the Task Role, and associate an IAM role with Amazon S3 write permissions as the Task Execution Role.
- Associate an IAM role with Amazon S3 write permissions as the Task Role, and associate an IAM role with CloudWatch Logs write permissions as the Task Execution Role.Cevap
- DAssociate an IAM role with Amazon S3 write permissions as the Task Role, and hardcode temporary AWS credentials for CloudWatch Logs write access within the container's environment variables.
Cevap
Associate an IAM role with Amazon S3 write permissions as the Task Role, and associate an IAM role with CloudWatch Logs write permissions as the Task Execution Role.
The correct answer correctly separates the roles: the Task Role provides AWS credentials to the application code running inside the container, granting access to Amazon S3. The Task Execution Role provides credentials to the Amazon ECS container agent, allowing it to write container logs to Amazon CloudWatch Logs.
Adım Adım Çözüm
Anahtar Kavram
ECS Task Role vs. ECS Task Execution Role
Tahmini Süre:1m 30s