Large Scale S3 to Glacier Migration Using Step Functions
The Challenge
Exploring Solutions
The Solution: Step Functions with Distributed Map
{
"Comment": "A description of my state machine",
"StartAt": "Map",
"States": {
"Map": {
"Type": "Map",
"ItemProcessor": {
"ProcessorConfig": {
"Mode": "DISTRIBUTED",
"ExecutionType": "STANDARD"
},
"StartAt": "Lambda Invoke",
"States": {
"Lambda Invoke": {
"Type": "Task",
"Resource": "arn:aws:states:::lambda:invoke",
"OutputPath": "$.Payload",
"Parameters": {
"FunctionName": "arn:aws:lambda:us-east-1:123456:function:transfer:$LATEST",
"Payload": {
"S3Key.$": "$.Items[*].Key",
"executionId.$": "$$.Execution.Id"
}
},
"Retry": [
{
"ErrorEquals": [
"Lambda.ServiceException",
"Lambda.AWSLambdaException",
"Lambda.SdkClientException",
"Lambda.TooManyRequestsException"
],
"IntervalSeconds": 1,
"MaxAttempts": 1,
"BackoffRate": 2
}
],
"End": true
}
}
},
"Label": "Map",
"MaxConcurrency": 50,
"ItemReader": {
"Resource": "arn:aws:states:::s3:listObjectsV2",
"Parameters": {
"Bucket": "bucket123"
},
"ReaderConfig": {}
},
"ItemBatcher": {
"MaxItemsPerBatch": 1100,
"MaxInputBytesPerBatch": 262144
},
"End": true,
"ToleratedFailurePercentage": 99
}
}
}Handling Additional Constraints
Conclusion
References and Further Reading
Last updated
