Skip to content

Instantly share code, notes, and snippets.

@bahrmichael
Created December 10, 2020 18:44
Show Gist options
  • Save bahrmichael/8aab5650c50ea71ec61f877e86d3ce9f to your computer and use it in GitHub Desktop.
Save bahrmichael/8aab5650c50ea71ec61f877e86d3ce9f to your computer and use it in GitHub Desktop.
{
"Comment": "A Hello World example of the Amazon States Language using Pass states",
"StartAt": "Invoke an API Gateway URL",
"States": {
"Invoke an API Gateway URL": {
"Type": "Task",
"Resource": "arn:aws:states:::apigateway:invoke",
"Parameters": {
"ApiEndpoint": "xxxxxxxxxx.execute-api.us-east-1.amazonaws.com",
"Method": "GET",
"Stage": "prod",
"Path": "/v2/status",
"AuthType": "NO_AUTH"
},
"Next": "Put item into DynamoDB"
},
"Put item into DynamoDB": {
"Type": "Task",
"Resource": "arn:aws:states:::dynamodb:putItem",
"Parameters": {
"TableName": "EsiStatusTable",
"Item": {
"pk": {
"S.$": "$.Headers.Date[0]"
},
"count": {
"N.$": "States.Format($.ResponseBody.players)"
}
}
},
"End": true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment