A developer is deploying a containerized application to Amazon ECS on AWS Fargate using the following task definition snippet:
{
"containerDefinitions": [
{
"name": "app-container",
"image": "111122223333.dkr.ecr.us-east-1.amazonaws.com/my-app:latest",
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "/ecs/my-app",
"awslogs-region": "us-east-1",
"awslogs-stream-prefix": "ecs"
}
}
}
],
"taskRoleArn": "arn:aws:iam::111122223333:role/MyTaskRole",
"executionRoleArn": "arn:aws:iam::111122223333:role/MyExecutionRole"
}
The application code inside the container must read and delete messages from an Amazon SQS queue. The ECS agent must pull the private container image from Amazon ECR and send container logs to Amazon CloudWatch Logs.
Which of the following configurations must the developer perform to grant the necessary permissions? (Select TWO.)
- Attach an IAM policy containing `sqs:ReceiveMessage` and `sqs:DeleteMessage` permissions to the MyTaskRole role.Cevap
- Attach an IAM policy containing `ecr:BatchGetImage`, `ecr:GetDownloadUrlForLayer`, `ecr:GetAuthorizationToken`, and `logs:PutLogEvents` permissions to the MyExecutionRole role.Cevap
- CAttach an IAM policy containing `sqs:ReceiveMessage` and `sqs:DeleteMessage` permissions to the MyExecutionRole role.
- DAttach an IAM policy containing `ecr:BatchGetImage`, `ecr:GetDownloadUrlForLayer`, `ecr:GetAuthorizationToken`, and `logs:PutLogEvents` permissions to the MyTaskRole role.
- EConfigure the trust relationship policy document of the MyExecutionRole role to allow the service principal `ecs.amazonaws.com` to perform the `sts:AssumeRole` action.