Question

Difficulty: MediumAWS Systems Manager Configuration and Run Command Automation

A SysOps Administrator is configuring an AWS Systems Manager Automation workflow to execute a custom script via Run Command on a fleet of Amazon EC2 instances targeted by instance tags. The instances are running, have the SSM Agent installed, and have the AmazonSSMManagedInstanceCore policy attached to their IAM instance profile. The administrator attempts to run the Automation using a custom IAM service role, but the execution fails immediately with an authorization error. Which actions must the administrator take to successfully execute the Automation? (Select TWO.)

  1. Attach an IAM policy to the administrator's IAM identity that grants the iam:PassRole permission for the Automation service role.Answer
  2. Configure the trust relationship of the Automation service role to allow the ssm.amazonaws.com service principal to assume the role.Answer
  3. C
    Configure a patch group tag on the EC2 instances that matches the name of the custom Run Command document.
  4. D
    Add an inline policy with sts:AssumeRole directly to the administrator's IAM user policy targeting the Automation service role.
  5. E
    Associate the target instances with a new subnet route table containing a route to a Systems Manager Gateway Endpoint.

Answer

Attach an IAM policy to the administrator's IAM identity that grants the iam:PassRole permission for the Automation service role, and configure the trust relationship of the Automation service role to allow the ssm.amazonaws.com service principal to assume the role.
To execute a Systems Manager Automation workflow using a custom service role, the executing administrator must have the iam:PassRole permission for that service role to delegate execution rights. Additionally, the service role itself must trust the Systems Manager service principal (ssm.amazonaws.com) to allow the service to assume the role and execute the tasks.

Step-by-Step Solution

1
Verify the trust policy of the custom IAM service role to ensure it allows the Systems Manager service principal (ssm.amazonaws.com) to assume it.
The Systems Manager Automation service is authorized to act on behalf of the user.
Systems Manager requires delegation authority to assume the role and execute the workflow.
2
Add the iam:PassRole permission to the administrator's IAM policy, specifying the ARN of the custom service role as the resource.
The administrator can successfully pass the service role to Systems Manager when launching the Automation.
The iam:PassRole permission is required for any user or role that passes an IAM role to an AWS service.

Key Concept

Delegating permissions to AWS Systems Manager Automation using service roles and the iam:PassRole permission.
Rate this question