Automating DataBrew with CloudWatch Events - AWS Glue DataBrew

Automating DataBrew with CloudWatch Events

Amazon CloudWatch Events enables you to automate your AWS services and respond automatically to system events such as application availability issues or resource changes. Events from AWS services are delivered to CloudWatch Events in near-real time. You can write simple rules to indicate which events are of interest to you, and what automated actions to take when an event matches a rule. The actions that can be automatically triggered include the following:

  • Invoking the Amazon EC2 run command

  • Relaying the event to Amazon Kinesis Data Streams

  • Activating an AWS Step Functions state machine

  • Notifying an Amazon SNS topic or an Amazon SQS queue

DataBrew reports an event to CloudWatch Events whenever the state of a resource in your AWS account changes. Events are emitted on a best effort basis.

Following are examples of several events, showing various states of a DataBrew job: SUCCEEDED, FAILED, TIMEOUT, and STOPPED.

{ "version": "0", "id": "abcdef00-1234-5678-9abc-def012345678", "detail-type": "DataBrew Job State Change", "source": "aws.databrew", "account": "123456789012", "time": "2017-09-07T18:57:21Z", "region": "us-west-2", "resources": [], "detail": { "jobName": "MyJob", "severity": "INFO", "state": "SUCCEEDED", "jobRunId": "db_abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789", "message": "Job run succeeded" } } { "version": "0", "id": "abcdef01-1234-5678-9abc-def012345678", "detail-type": "DataBrew Job State Change", "source": "aws.databrew", "account": "123456789012", "time": "2017-09-07T06:02:03Z", "region": "us-west-2", "resources": [], "detail": { "jobName": "MyJob", "severity": "ERROR", "state": "FAILED", "jobRunId": "db_0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", "message": "AnalysisException: 'Path does not exist: s3://MyBucket/MyFile;'" } } { "version": "0", "id": "abcdef00-1234-5678-9abc-def012345678", "detail-type": "DataBrew Job State Change", "source": "aws.databrew", "account": "123456789012", "time": "2017-11-20T20:22:06Z", "region": "us-east-2", "resources": [], "detail": { "jobName": "MyJob", "severity": "WARN", "state": "TIMEOUT", "jobRunId": "db_abc0123456789abcdef0123456789abcdef0123456789abcdef0123456789def", "message": "Job run timed out" } } { "version": "0", "id": "abcdef00-1234-5678-9abc-def012345678", "detail-type": "DataBrew Job State Change", "source": "aws.databrew", "account": "123456789012", "time": "2017-11-20T20:22:06Z", "region": "us-east-2", "resources": [], "detail": { "jobName": "MyJob", "severity": "INFO", "state": "STOPPED", "jobRunId": "db_abc0123456789abcdef0123456789abcdef0123456789abcdef0123456789def", "message": "Job run stopped" } }

For more information, see the Amazon CloudWatch Events User Guide.