This AWS CloudFormation template provides a solution for using pre-signed URLs to upload files to Amazon S3. The solution consists of an S3 bucket, a Lambda function, a DynamoDB table, and an API Gateway to expose the Lambda function as an HTTP API.
- An AWS account with the necessary permissions to create the resources defined in this template.
- A basic understanding of AWS CloudFormation and AWS Lambda.
To use this template, follow these steps:
- Create an S3 bucket and replace
YOUR_BUCKET_NAME
in the CloudFormation template with your bucket name. - Package and upload your Lambda function code to your S3 bucket, and replace
YOUR_LAMBDA_FUNCTION_CODE.zip
in the CloudFormation template with the name of your Lambda function code file. - Replace
YOUR_LAMBDA_FUNCTION_NAME
in the CloudFormation template with the name of your Lambda function. - Create a DynamoDB table and replace
YOUR_TABLE_NAME
in the CloudFormation template with your table name. - Replace
YOUR_INDEX_NAME
in the CloudFormation template with a unique name for your DynamoDB global secondary index. - Deploy the CloudFormation template to create the necessary resources.
The following resources are created by this CloudFormation template:
- S3 bucket: An S3 bucket that is used to store uploaded files.
- Lambda function: A Lambda function that generates pre-signed URLs for S3 uploads and stores upload metadata in a DynamoDB table.
- DynamoDB table: A DynamoDB table that is used to store upload metadata.
- IAM role: An IAM role that grants the Lambda function permissions to access S3 and DynamoDB.
- API Gateway: An API Gateway that exposes the Lambda function as an HTTP API.
This project is licensed under the terms of the MIT license. See LICENSE for more information.