Question

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

A SysOps administrator is configuring an Amazon EventBridge Scheduler schedule to invoke an AWS Lambda function on a recurring basis. The schedule must execute using a custom IAM service role named SchedulerExecutionRole that has permissions to invoke the Lambda function. When the administrator attempts to create the schedule, the operation fails with a permission error indicating that the schedule cannot be created. Which of the following actions must be taken to successfully create the schedule? (Select TWO.)

  1. Add a statement to the trust policy of the SchedulerExecutionRole to allow the scheduler.amazonaws.com service principal to perform the sts:AssumeRole action.Answer
  2. Attach an IAM policy to the administrator's IAM user that allows the iam:PassRole action on the SchedulerExecutionRole resource.Answer
  3. C
    Attach an IAM policy to the administrator's IAM user that allows the sts:AssumeRole action on the SchedulerExecutionRole resource.
  4. D
    Add a statement to the trust policy of the SchedulerExecutionRole to allow the administrator's IAM user to perform the sts:AssumeRole action.

Answer

To resolve the permission issue, the trust policy of the SchedulerExecutionRole must be updated to allow the EventBridge Scheduler service principal (scheduler.amazonaws.com) to assume the role, and the SysOps administrator's IAM user must be granted the iam:PassRole permission to pass the role to the scheduler service.
To successfully configure Amazon EventBridge Scheduler to run using a custom execution role, two configuration conditions must be met: the scheduler service principal (scheduler.amazonaws.com) must have trust permissions to assume the role via its trust policy, and the deploying IAM identity must have the iam:PassRole permission to pass the role to the service.

Step-by-Step Solution

1
Ensure the service principal for the AWS service is trusted to assume the IAM role.
The trust policy of SchedulerExecutionRole allows scheduler.amazonaws.com to perform the sts:AssumeRole action.
EventBridge Scheduler needs to temporarily assume the execution role's identity to execute the Lambda function on your behalf.
2
Ensure the user configuring the service has permission to delegate the IAM role.
The SysOps administrator's IAM user is granted the iam:PassRole permission for the SchedulerExecutionRole.
AWS prevents users from passing arbitrary roles with elevated privileges to services by requiring the iam:PassRole permission.

Key Concept

AWS Service Role Delegation and Trust Relationships
Rate this question