使用 CloudWatch Events 监控您的策略 - Amazon Elastic Compute Cloud

使用 CloudWatch Events 监控您的策略

Amazon EBS 和 Amazon Data Lifecycle Manager 发出与生命周期策略操作相关的事件。您可以使用 AWS Lambda 和 Amazon CloudWatch Events 以编程方式处理事件通知。尽最大努力发出事件。有关更多信息,请参阅 Amazon CloudWatch Events 用户指南

提供的事件如下:

注意

AMI 生命周期策略操作不会触发任何事件。

  • createSnapshot – 当 CreateSnapshot 操作成功或失败时,会发出 Amazon EBS 事件。有关更多信息,请参阅适用于 Amazon EBS 的 Amazon CloudWatch Events

  • DLM Policy State Change – 当生命周期策略进入错误状态时,会发出 Amazon Data Lifecycle Manager 事件。此事件包含有关导致错误的问题的描述。下面是在 IAM 角色授予的权限不足时发出的事件的示例。

    { "version": "0", "id": "01234567-0123-0123-0123-0123456789ab", "detail-type": "DLM Policy State Change", source": "aws.dlm", "account": "123456789012", "time": "2018-05-25T13:12:22Z", "region": "us-east-1", "resources": [ "arn:aws:dlm:us-east-1:123456789012:policy/policy-0123456789abcdef" ], "detail": { "state": "ERROR", "cause": "Role provided does not have sufficient permissions", "policy_id": "arn:aws:dlm:us-east-1:123456789012:policy/policy-0123456789abcdef" } }

    下面是在超过限制时发出的事件的示例。

    { "version": "0", "id": "01234567-0123-0123-0123-0123456789ab", "detail-type": "DLM Policy State Change", "source": "aws.dlm", "account": "123456789012", "time": "2018-05-25T13:12:22Z", "region": "us-east-1", "resources": [ "arn:aws:dlm:us-east-1:123456789012:policy/policy-0123456789abcdef" ], "detail":{ "state": "ERROR", "cause": "Maximum allowed active snapshot limit exceeded", "policy_id": "arn:aws:dlm:us-east-1:123456789012:policy/policy-0123456789abcdef" } }