2

我正在尝试为 EC2 实例设置重启操作,参考以下指南。 https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/UsingAlarmActions.html#AddingRebootActions

警报工作正常并向给定的 SNS 主题发送电子邮件,但是,重新启动操作失败。以下是我看到的错误。

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
}

我的服务角色具有所有需要的权限集。

{
    "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": "*"
        }
    ]
}
4

1 回答 1

0

Failed to execute action arn:aws:swf:us-east-1:xxxxxxxxxx:action/actions/AWS_EC2.InstanceId.Terminate/1.0. Received error: ""可能是由于在警报定义中使用了无效的InstanceId造成的。

于 2019-10-27T10:34:04.320 回答