Question

Difficulty: EasyIAM Policies, Roles, and Service Control Policies (SCPs)

A SysOps administrator is deploying a containerized application to Amazon Elastic Container Service (Amazon ECS). The application tasks must read messages from an Amazon SQS queue. The administrator creates an IAM role for the tasks but receives an authorization error when attempting to run the task using this role.

Which of the following configurations are required to resolve this issue? (Select TWO.)

  1. Modify the trust relationship of the IAM role to allow the Amazon ECS tasks service principal to perform the AssumeRole action.Answer
  2. Attach a permissions policy to the SysOps administrator's IAM identity that allows the PassRole action on the IAM role.Answer
  3. C
    Attach a permissions policy to the SysOps administrator's IAM identity that allows the AssumeRole action on the IAM role.
  4. D
    Modify the trust relationship of the IAM role to allow the Amazon SQS service principal to perform the PassRole action.

Answer

To resolve the authorization error, the SysOps administrator must modify the trust relationship of the IAM role to allow the Amazon ECS tasks service principal to perform the AssumeRole action, and attach a permissions policy to the administrator's IAM identity that allows the PassRole action on the IAM role.
The correct configurations involve allowing the ECS task service principal to assume the role by modifying the role's trust relationship, and granting the administrator the PassRole permission to authorize them to pass the role to the ECS tasks.

Step-by-Step Solution

1
Configure the trust relationship on the task role.
The Amazon ECS tasks service principal (ecs-tasks.amazonaws.com) is trusted to assume the role.
This allows the container tasks to acquire the credentials associated with the IAM role.
2
Grant the administrator the permission to pass the role.
The administrator's IAM policy is updated to include the PassRole permission for this specific IAM role.
This authorizes the administrator to delegate the role's permissions to the ECS task.

Key Concept

Delegating IAM roles to AWS services requires configuring both a trust relationship on the role and PassRole permissions on the deploying identity.
Rate this question