Skip to content

Instantly share code, notes, and snippets.

@leegilmorecode
Created November 15, 2021 15:05
Show Gist options
  • Select an option

  • Save leegilmorecode/4c578335a395db3694ecd41e70d83b51 to your computer and use it in GitHub Desktop.

Select an option

Save leegilmorecode/4c578335a395db3694ecd41e70d83b51 to your computer and use it in GitHub Desktop.
InputTransformations in EventBridge rule
EventRule:
Type: AWS::Events::Rule
Properties:
Description: 'PayslipUploadedEventRule'
EventBusName: 'HREventBus'
EventPattern:
account:
- !Sub '${AWS::AccountId}'
source:
- 'payslip.uploaded'
Targets:
- Arn: !GetAtt PDFGenQueue.Arn
Id: 'PDFGenQueue'
SqsParameters:
MessageGroupId: 'PayslipUploaded'
InputTransformer:
InputPathsMap:
'detail': '$.detail'
'detail-type': '$.detail-type'
'source': '$.source'
'account': '$.account'
'region': '$.region'
InputTemplate: |
{
"detail" : <detail>,
"detail-type" : "<detail-type>",
"source": "<source>",
"account" : "<account>",
"region" : "<region>"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment