Skip to content

Instantly share code, notes, and snippets.

@hassaku63
Created December 28, 2019 11:44
Show Gist options
  • Save hassaku63/4149ed888476a5cd3cd06eb3b2aa3a69 to your computer and use it in GitHub Desktop.
Save hassaku63/4149ed888476a5cd3cd06eb3b2aa3a69 to your computer and use it in GitHub Desktop.
s3にputしたオブジェクトを言語検出→感情分析して結果をSNS通知するワークフローを実装するStepFunctionsのASL定義
{
"Comment": "A Hello World example of the Amazon States Language using Pass states",
"StartAt": "DetectLanguageJob",
"States": {
"DetectLanguageJob": {
"Type": "Task",
"Resource": "arn:aws:states:::lambda:invoke",
"Parameters": {
"FunctionName": "arn:aws:lambda:ap-northeast-1:012345678901:function:InvokeDetectLanguageFunctionName:$LATEST",
"Payload": {
"Input.$": "$"
}
},
"Next": "DetectSentimentJob"
},
"DetectSentimentJob": {
"Type": "Task",
"Resource": "arn:aws:states:::lambda:invoke",
"Parameters": {
"FunctionName": "arn:aws:lambda:ap-northeast-1:012345678901:function:InvokeDetectSentimentFunctionName:$LATEST",
"Payload": {
"Input.$": "$"
}
},
"Next": "SnsNotification"
},
"SnsNotification": {
"Type": "Task",
"Resource": "arn:aws:states:::sns:publish",
"Parameters": {
"Message": {
"Input.$": "$"
},
"TopicArn": "arn:aws:sns:ap-northeast-1:012345678901:topicName"
},
"End": true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment