使用 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 事件。如需詳細資訊,請參閱 EventBridge for Amazon EBS

  • 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" } }