Skip to content

Instantly share code, notes, and snippets.

@zaccharles
Created October 4, 2019 12:13
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 zaccharles/9977bde6d5b4db57d2a4460073158bae to your computer and use it in GitHub Desktop.
Save zaccharles/9977bde6d5b4db57d2a4460073158bae to your computer and use it in GitHub Desktop.
Step Functions Asynchronous Communication - Example 1
service: example1
plugins:
- serverless-step-functions
- serverless-iam-roles-per-function
provider:
name: aws
runtime: nodejs10.x
region: eu-west-1
functions:
worker:
handler: worker.handler
iamRoleStatements:
- Effect: "Allow"
Action:
- states:SendTaskSuccess
Resource:
Ref: ExampleStateMachine
stepFunctions:
stateMachines:
example:
name: ExampleStateMachine
definition:
StartAt: PublishAndWait
States:
PublishAndWait:
Type: Task
Resource: arn:aws:states:::sqs:sendMessage.waitForTaskToken
Parameters:
QueueUrl:
Ref: ExampleRequestQueue
MessageBody:
Input.$: "$"
TaskToken.$: "$$.Task.Token"
End: true
resources:
Resources:
ExampleRequestQueue:
Type: AWS::SQS::Queue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment