Skip to content

Instantly share code, notes, and snippets.

@alexcasalboni
Created October 8, 2019 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexcasalboni/f8712d16bc124dc3a9ca934929eeef26 to your computer and use it in GitHub Desktop.
Save alexcasalboni/f8712d16bc124dc3a9ca934929eeef26 to your computer and use it in GitHub Desktop.
Amazon Pinpoint - Custom Segment Lambda function (YAML)
AWSTemplateFormatVersion : '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
myHookFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
# ...
# all the other properties here
# ...
myPinpointApp:
Type: AWS::Pinpoint::App
Properties:
Name: MySampleApp
myPinpointSegment:
Type: AWS::Pinpoint::Segment
Properties:
ApplicationId: !Ref myPinpointApp
Name: 'My segment'
myPinpointAPNSChannel:
Type: AWS::Pinpoint::APNSChannel
Properties:
ApplicationId: !Ref myPinpointApp
# ...
# all the other properties here
# ...
myPinpointCampaign:
Type: AWS::Pinpoint::Campaign
Properties:
ApplicationId: !Ref myPinpointApp
SegmentId: !GetAtt myPinpointSegment.SegmentId
MessageConfiguration: {...}
CampaignHook:
LambdaFunctionName: !Ref myHookFunction
Mode: FILTER
Schedule:
StartTime: '2019-11-01T15:00:00.000'
TimeZone: UTC
# ...
# all the other properties here
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment