A developer is configuring a backend worker application to run on Amazon ECS using the AWS Fargate launch type. The application code running inside the container needs to read and write items in an Amazon DynamoDB table. The container image is hosted in a private Amazon ECR repository located in a separate, central shared AWS account. Additionally, the task definition retrieves sensitive database credentials stored in encrypted AWS Systems Manager Parameter Store parameters and injects them as environment variables at task startup. Which of the following configuration steps are required to successfully deploy the task and run the application? (Select TWO.)
- Assign an IAM role as the Task Role that contains a policy granting dynamodb:GetItem and dynamodb:PutItem permissions on the target DynamoDB table.Answer
- Assign an IAM role as the Task Execution Role that contains policies granting ssm:GetParameters and kms:Decrypt permissions, and configure the central ECR repository policy to allow ECR pull actions for this role.Answer
- CAssign an IAM role as the Task Execution Role that contains a policy granting dynamodb:GetItem and dynamodb:PutItem permissions on the target DynamoDB table.
- DAttach a policy to the Task Role granting ssm:GetParameters and kms:Decrypt permissions to enable the containerized application to pull the environment variables at launch.
- EConfigure the trust relationship of the Task Execution Role to allow the central ECR repository's service principal ecr.amazonaws.com to assume the role.
Answer
To successfully deploy and run the application, you must assign an IAM role as the Task Role with DynamoDB access policy, and assign another IAM role as the Task Execution Role with SSM Parameter Store and KMS decryption permissions, while updating the central ECR repository policy to allow cross-account pulls.
The correct options are: assigning an IAM role as the Task Role with DynamoDB permissions, and assigning an IAM role as the Task Execution Role with SSM Parameter Store and KMS permissions alongside ECR cross-account repository access. This correctly separates the runtime application permissions (Task Role) from the container startup and orchestration permissions (Task Execution Role).
Step-by-Step Solution
Key Concept
Delineating responsibilities and permissions between the ECS Task Role and the ECS Task Execution Role for Fargate deployments.