Soru

Zorluk: KolayAmazon ECS and Docker Deployment

An application running inside a Docker container on Amazon ECS needs to query an Amazon DynamoDB table. Which configuration should the developer specify in the task definition to grant the containerized application permissions to access DynamoDB?

  1. Define the permissions in the taskRoleArn parameter of the task definitionCevap
  2. B
    Define the permissions in the executionRoleArn parameter of the task definition
  3. C
    Store IAM access keys in the application code and configure the default credential chain
  4. D
    Configure the ECS service-linked role with policies for DynamoDB

Cevap

Define the permissions in the taskRoleArn parameter of the task definition
The correct option is to define the permissions in the taskRoleArn parameter of the task definition. This assigns an IAM Task Role to the container, which is used by the application inside the container to authorize its calls to services like Amazon DynamoDB using the AWS SDK.

Adım Adım Çözüm

1
Determine which component needs to access the Amazon DynamoDB table.
The application code running inside the container needs the access.
This helps distinguish between application-level requirements and container-orchestration-level requirements.
2
Identify the correct parameter in the ECS task definition designed for container application permissions.
The taskRoleArn parameter represents the ECS Task Role.
The Task Role credentials are automatically injected into the container environment for the SDK to use.

Anahtar Kavram

ECS Task Role vs Task Execution Role
Bu soruyu puanla