Let’s quickly create a Queue using all the default values


Let’s copy the URL (not ARN) :

Create a State Machine in Step Function

Pass this ASL : (make sure to replace the QueueURL)

{
"Comment": "Transaction Processor State Machine Using SQS",
"StartAt": "ProcessTransaction",
"States": {
"ProcessTransaction": {
"Type": "Pass",
"Next": "BroadcastToSqs"
},
"BroadcastToSqs": {
"Type": "Task",
"Resource": "arn:aws:states:::sqs:sendMessage",
"Parameters": {
"QueueUrl": "<https://sqs.us-east-1.amazonaws.com/967277549983/SQSFromStepFunction>",
"MessageBody": {
"TransactionId.$": "$.TransactionId",
"Type.$": "$.Type"
}
},
"End": true
}
}
}
Input would be :
{
"TransactionId": "abc",
"Type": "PURCHASE"
}
Basically,