A SysOps administrator is configuring an automated task using Amazon EventBridge Scheduler to run an AWS Systems Manager (SSM) Automation runbook (`AWS-StopEC2Instance`) on a weekly schedule. The SSM Automation runbook must execute using a service role named `SSMRemediationRole`. The EventBridge Scheduler schedule will run under a service role named `EventBridgeSchedulerExecutionRole`. When the administrator attempts to create the schedule using the AWS CLI, the command fails with an `AccessDeniedException` error. Which of the following actions must the administrator take to resolve this issue and successfully run the scheduled automation? (Select TWO.)
- Attach an IAM policy to the administrator's IAM identity that allows the `iam:PassRole` action on the `EventBridgeSchedulerExecutionRole` resource.Cevap
- Attach an IAM policy to the `EventBridgeSchedulerExecutionRole` that allows the `iam:PassRole` action on the `SSMRemediationRole` resource.Cevap
- CAttach an IAM policy to the administrator's IAM identity that allows the `sts:AssumeRole` action on the `EventBridgeSchedulerExecutionRole` resource.
- DModify the trust policy of the `SSMRemediationRole` to allow the `scheduler.amazonaws.com` service principal to assume the role.
- EAttach an IAM policy to the `EventBridgeSchedulerExecutionRole` that allows the `sts:AssumeRole` action on the `SSMRemediationRole` resource.
Cevap
Attach an IAM policy to the administrator's IAM identity that allows the `iam:PassRole` action on the `EventBridgeSchedulerExecutionRole` resource, and attach an IAM policy to the `EventBridgeSchedulerExecutionRole` that allows the `iam:PassRole` action on the `SSMRemediationRole` resource.
To resolve the access denied issue, two distinct `iam:PassRole` permissions are required. First, the administrator's IAM identity must be allowed to pass the scheduler execution role (`EventBridgeSchedulerExecutionRole`) to the EventBridge Scheduler service when creating the schedule. Second, because the scheduler must start the SSM Automation runbook using the remediation role (`SSMRemediationRole`), the scheduler's execution role itself must be allowed to pass the remediation role to the Systems Manager service.
Adım Adım Çözüm
Anahtar Kavram
Configuring IAM PassRole and service delegation for multi-layered service invocations.