Amazon S3 to AWS Lambda

S3 → Custom Resource → S3

Upload large file to S3 buckets with custom resources.

The samples in this project demonstrate how to upload large file to S3 Bucket using CDK using the inbuilt CDK Assets Bucket and Custom Resource.
Assets are local files, directories, or Docker images that can be bundled into AWS CDK libraries and apps; for example, a directory that contains the handler code for an AWS Lambda function. Assets can represent any artifact that the app needs to operate. You can define local files and directories as assets, and the AWS CDK packages and uploads them to Amazon S3 through the aws-s3-assets module.
A Lambda Backed Custom Resource can be used to copy your large file from the assets bucket to your custom s3 bucket

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/s3-large-deployments-cdk

Deploy

cdk deploy --context filename=<sample file name> --context s3bucketname=<the name of the s3 bucket> --all


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: npx cdk destroy.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus".
3. You see a message confirming DELETE_COMPLETE.

Created by:

Payal Shah

I am Professional Service Consultant specialised in DevOps/CIA. My major area of focus is working around IAC tools.