I'm attempting to use a cloudformation template to create a cloudwatch event rule that matches a glue event and targets an SNS topic to send a message to, I can create it in the cloudwatch console, but not via a cloud watch template. Here is my event rule:
NotifyEventRule:
Type: AWS::Events::Rule
Properties:
Name: JobNotifyEvent
Description: Notification event on job status change.
EventPattern:
source:
- aws.glue
account:
- !Ref AWS::AccountId
detail-type:
- Glue Job State Change
detail:
jobName:
- !Ref GlueJobName
Targets:
-
Arn:
Ref: "JobNotificationTopic"
Id:
Ref: "JobNotificationTopicName"
InputTransformer:
InputTemplate: "Job finished in the following state: <state>."
InputPathsMap:
state: "$.detail.state"
The problem is with InputTemplate. The error I get is:
Invalid InputTemplate for target JobNotificationTopic : [Source: (String)"Job finished in the following state: null."; line: 1, column: 10]. (Service: AmazonCloudWatchEvents; Status Code: 400; Error Code: ValidationException; Request ID: 12345678...)
It seems like <state>
may be the problem.