Skip to content

Easy way to integrate Amazon's HttpApi with S3. It allows to circumvent the limitations (missing S3 integration on ApiGw2) by having Lambda in between. This way you can keep your buckets private.

License

Notifications You must be signed in to change notification settings

sladg/s3-lambda

Repository files navigation

S3Lambda

S3 is a simple AWS Lambda function that allows for integration between HttpApi (v2) and S3. This integration is currently not supported on HttpApi resulting in need to use HttpIntegration and having bucket on public-read which is not desired.

This function circumvents this limitation by standing between ApiGateway and S3 and proxying events.

Usage

Very simple and straight forward npx --package @sladg/s3-lambda cli deploy. Pass --help in the end for all options and configuration.

In case you want to clean it up, use npx --package @sladg/s3-lambda cli remove.

Command will output "s3LambdaArn" that you can use to make requests.

Note

We are using pathParameters.proxy as key for S3, so you should set your HttpApi with /prefix/{proxy+} route, where prefix won't be passed to S3. There is currently no setting for using multiple S3 buckets or setting prefix for S3 key.

About

Easy way to integrate Amazon's HttpApi with S3. It allows to circumvent the limitations (missing S3 integration on ApiGw2) by having Lambda in between. This way you can keep your buckets private.

Topics

Resources

License

Stars

Watchers

Forks