Skip to content

Instantly share code, notes, and snippets.

@owfm
Last active May 16, 2020 11:51
Show Gist options
  • Save owfm/d01421b9db70afcbf93ac8549aa19ade to your computer and use it in GitHub Desktop.
Save owfm/d01421b9db70afcbf93ac8549aa19ade to your computer and use it in GitHub Desktop.
# serverless.yml [truncated]
# ...
States:
ProposePromotion:
Type: Task
Resource: !GetAtt [proposePromotion, Arn]
ResultPath: "$.employeeDetails"
Next: GetManualReview
GetManualReview:
Type: Task
Resource: arn:aws:states:::lambda:invoke.waitForTaskToken
Parameters:
FunctionName: ${self:service}-${opt:stage}-storePromotions
Payload:
employeeDetails.$: "$.employeeDetails"
taskToken.$: "$$.Task.Token"
ResultPath: "$.decision"
Next: PromotionDecision
PromotionDecision:
Type: Choice
Choices:
- Variable: "$.decision"
StringEquals: approved
Next: EmailCongratulations
- Variable: "$.decision"
StringEquals: rejected
Next: EmailCommiserations
EmailCongratulations:
Type: Task
Resource: !GetAtt [emailCongratulations, Arn]
End: true
EmailCommiserations:
Type: Task
Resource: !GetAtt [emailCommiserations, Arn]
End: true
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment