Security

An application running in Amazon ECS needs to call DynamoDB through an AWS SDK without stored access keys. Which configuration provides credentials specifically to the application containers?

Show the answer

Correct answerB. Assign an IAM task role in the task definition.

AWhy not this: A table resource policy can authorize access but does not supply credentials to the application.

BWhy this is right: A task role supplies temporary credentials to containers for application calls to AWS services.

CWhy not this: The task execution role supports the ECS agent's work; its credentials are not supplied to application containers.

DWhy not this: The ECS service-linked role lets ECS manage supporting resources, not provide application credentials.

An ECS task role supplies temporary credentials that application containers can use through an AWS SDK. The task execution role supports ECS operations such as pulling images and publishing logs, rather than application API calls.