skip to Main Content

I’m creating a role to reboot automatically an EC2 instance. But I’m getting this error "The execution role you provide must allow AWS EventBridge Scheduler to assume the role."

enter image description here

In the role, I’ve added those permissions

enter image description here

I know it’s mostly too much but still not enough cause I’m getting the error… Any idea ?

2

Answers


  1. Since the error message indicates EventBridge Scheduler is unable to assume the role, you are probably missing the IAM piece that allows the "sts:AssumeRole" action. This doc for IAM describes where you need to add these permissions.

    "Effect": "Allow",
    "Action": "sts:AssumeRole",
    "Resource": "arn:aws:iam::account_id_number:role/role-name-you-want-to-assume"
    
    Login or Signup to reply.
  2. You need to add the below trust policy to your execution role which will allow EventBridge Scheduler to assume the role.

    Open IAM Console → In the navigation pane of the console, choose Roles and then choose your role → Select Trust Relationship tab → Click on Edit trust Policy and add the below policy.

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Principal": {
                    "Service": "scheduler.amazonaws.com"
                },
                "Action": "sts:AssumeRole"
            }
        ]
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search