Monitor your policies using CloudWatch Events - Amazon EBS

Monitor your policies using CloudWatch Events

Amazon EBS and Amazon Data Lifecycle Manager emit events related to lifecycle policy actions. You can use AWS Lambda and Amazon CloudWatch Events to handle event notifications programmatically. Events are emitted on a best effort basis. For more information, see the Amazon CloudWatch Events User Guide.

The following events are available:

Note

No events are emitted for AMI lifecycle policy actions.

  • createSnapshot — An Amazon EBS event emitted when a CreateSnapshot action succeeds or fails. For more information, see Amazon EventBridge for Amazon EBS.

  • DLM Policy State Change — An Amazon Data Lifecycle Manager event emitted when a lifecycle policy enters an error state. The event contains a description of what caused the error.

    The following is an example of an event when the permissions granted by the IAM role are insufficient.

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

    The following is an example of an event when a limit is exceeded.

    { "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" } }
  • DLM Pre Post Script Notification — An event that is emitted when a pre or post script is initiated, succeeds, or fails.

    The following is an example event when a VSS backup succeeds.

    { "version": "0", "id": "12345678-1234-1234-1234-123456789012", "detail-type": "DLM Pre Post Script Notification", "source": "aws.dlm", "account": "123456789012", "time": "2023-10-27T22:04:52Z", "region": "us-east-1", "resources": ["arn:aws:dlm:us-east-1:123456789012:policy/policy-01234567890abcdef"], "detail": { "script_stage": "", "result": "success", "cause": "", "policy_id": "arn:aws:dlm:us-east-1:123456789012:policy/policy-01234567890abcdef", "execution_handler": "AWS_VSS_BACKUP", "source": "arn:aws:ec2:us-east-1:123456789012:instance/i-01234567890abcdef", "resource_type": "EBS_SNAPSHOT", "resources": [{ "status": "pending", "resource_id": "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef", "source": "arn:aws:ec2:us-east-1:123456789012:volume/vol-01234567890abcdef" }], "request_id": "a1b2c3d4-a1b2-a1b2-a1b2-a1b2c3d4e5f6", "start_time": "2023-10-27T22:03:29.370Z", "end_time": "2023-10-27T22:04:51.370Z", "timeout_time": "" } }