Milindu Sanoj Kumarage
Milindu Sanoj Kumarage

Reputation: 2783

CloudWatch Reboot Alarm Action failed to execute

I'm trying to setup Reboot Action for an EC2 instance referring the following guideline. https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/UsingAlarmActions.html#AddingRebootActions

The alarm works fine and sends an email to the given SNS topic, however, the Reboot action fails. Following is the error I see.

Failed to execute action arn:aws:swf:us-east-1:xxxxxxxxxx:action/actions/AWS_EC2.InstanceId.Reboot/1.0. Received error: 
{
  "actionState": "Failed",
  "stateUpdateTimestamp": 1571814054523,
  "notificationResource": "arn:aws:swf:us-east-1:xxxxxxxxxx:action/actions/AWS_EC2.InstanceId.Reboot/1.0",
  "publishedMessage": null,
  "error": null
}

My Service role has all the needed permissions set.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "cloudwatch:DescribeAlarms",
                "ec2:DescribeInstanceStatus",
                "ec2:DescribeInstances",
                "ec2:DescribeSnapshots",
                "ec2:DescribeVolumeStatus",
                "ec2:DescribeVolumes",
                "ec2:RebootInstances",
                "ec2:StopInstances",
                "ec2:TerminateInstances",
                "ec2:CreateSnapshot"
            ],
            "Resource": "*"
        }
    ]
}

Upvotes: 2

Views: 923

Answers (1)

Viliam Pucik
Viliam Pucik

Reputation: 559

Failed to execute action arn:aws:swf:us-east-1:xxxxxxxxxx:action/actions/AWS_EC2.InstanceId.Terminate/1.0. Received error: "" can be caused by using an invalid InstanceId in the alarm definition.

Upvotes: 1

Related Questions