Repository navigation
New serverless pattern - s3-multipart-getpart-sqs-lambda-typescript-cdk - #3569
Open
NithinChandranR-AWS wants to merge 1 commit into
Conversation
…tipart upload parts in progress with GetPart - Amazon S3 PartUploaded, Aborted and CompleteMultipartUpload events to an Amazon SQS queue with a dead-letter queue - AWS Lambda reads each part with GetPart while the upload is in progress, streams a SHA-256 hash, checks the S3 checksum - Amazon DynamoDB part ledger with conditional writes for duplicate, out-of-order and superseded events - Bundled AWS SDK for JavaScript S3 client (GetPart), explicit log group, least-privilege IAM
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Process Amazon S3 multipart upload parts while the upload is in progress with Amazon SQS and AWS Lambda. Amazon S3 sends each
s3:MultipartUpload:PartUploadedevent to an Amazon SQS queue, and an AWS Lambda function reads that part with the new Amazon S3 GetPart API before the upload completes, hashes it and records it in an Amazon DynamoDB part ledger that the completion or abort event closes. Claim issue: #3568.Key Innovation
Uses the
s3:MultipartUpload:PartUploadedevent and the GetPart API (announced 2026-11-29) to read parts during the upload. The nearest existing pattern, s3-sqs-lambda-dynamodb, processes whole objects after ObjectCreated; this one reads each part while the upload runs and keeps the ledger correct under duplicate, out-of-order and superseded part events.Architecture
Amazon S3 (PartUploaded, Aborted, CompleteMultipartUpload) -> Amazon SQS (+ dead-letter queue) -> AWS Lambda (GetPart, SHA-256) -> Amazon DynamoDB part ledger
Deployed and Tested
Deployed in us-east-1 (~90 s), 20 CloudFormation resources. README Testing run as written in zsh and in macOS bash 3.2, with the Region set only by the README's
export AWS_REGION=us-east-1:IN_PROGRESSand a matching SHA-256 checksum, thesha256Hexof each part equal to the localshasumof the uploaded file, anUPLOADrowIN_PROGRESS, andhead-objectreturning 404 Not Foundcomplete-multipart-upload:UPLOADCOMPLETEwith the object size 10485760UPLOADABORTED, dead-letter queue 0; the deployed queue readsmaxReceiveCount5cdk destroyleft only the two CDK helper log groups that the README listsChecklist
s3:GetObject+s3:GetIncompleteUploadon this bucket's objects only, in-progress reads verified with the deployed role; SQS consume on one queue;PutItem/UpdateItemon one table)validate.jspasses, including the admin IAM check