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?
- Define the permissions in the taskRoleArn parameter of the task definitionCevap
- BDefine the permissions in the executionRoleArn parameter of the task definition
- CStore IAM access keys in the application code and configure the default credential chain
- DConfigure 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
Anahtar Kavram
ECS Task Role vs Task Execution Role