Да, вы можете перехватить ошибку после повторной попытки и отправить ее в SQS. Вот пример.
{
"StartAt": "GetMyRecords",
"States": {
"GetMyRecords": {
"Type": "Task",
"Resource": "<resource arn>",
"TimeoutSeconds": 80,
"Retry": [
{
"ErrorEquals": [
"CustomError"
],
"IntervalSeconds": 300,
"MaxAttempts": 10,
"BackoffRate": 1.1
}
],
"Catch": [
{
"ErrorEquals": [
"CustomError"
],
"Next": "SendToSQS",
"ResultPath": "$.error"
}
],
"End": true
},
"SendToSQS": {
"Type": "Task",
"Resource": "arn:aws:states:::sqs:sendMessage",
"Parameters": {
"QueueUrl": "https://sqs.us-east-1.amazonaws.com/123456789012/myQueue",
"MessageBody.$": "$.input.message",
"MessageAttributes": {
"MyAttribute1": {
"DataType": "String",
"StringValue": "Value of attribute 1"
},
"MyAttribute1": {
"DataType": "String",
"StringValue": "Value of attribute 2"
}
}
},
"End": true
}
}
}