IAM role needed for EventBridge scheduled reboot of EC2 instances

0

Which IAM role(s) are needed for rebooting EC2 instances via EventBridge?

1 Answer
1

Please use this link https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-iam.html

Please create a role with the following json!

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "CloudWatchEventsBuiltInTargetExecutionAccess",
            "Effect": "Allow",
            "Action": [
                "ec2:RebootInstances",
                "ec2:StopInstances",
                "ec2:TerminateInstances"
            ],
            "Resource": [
                "arn:aws:ec2:ap-south-1:AWS_ACCOUNT_ID:instance/YOUR_INSTANCE_ID"
            ]
        }
    ]
}

Please use this as a trust relationship

{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Effect": "Allow",
			"Principal": {
				"Service": "events.amazonaws.com"
			},
			"Action": "sts:AssumeRole"
		}
	]
}
profile picture
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions