IAM role needed for EventBridge scheduled reboot of EC2 instances

0

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

1 個回答
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
專家
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南