dennmart / s3-presigner-api

Serverless application using Terraform to generate pre-signed URLs for a private S3 object with Lambda and API Gateway

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

S3 Presigner API

This project demonstrates how to set up a serverless application using Terraform to generate pre-signed URLs for a private S3 object with Lambda and API Gateway.

Application overview

S3 Presigner API Architecture

  1. The user sends a request to the API Gateway endpoint with an API key (x-api-key header).
  2. If the API key is valid, API Gateway invokes a Lambda function.
  3. The Lambda function checks for a private object inside of an Amazon S3 bucket that it has access to.
  4. If Lambda can access the object, the function generates a temporary pre-signed URL for the object (expires in 60 seconds).
  5. The Lambda function returns the pre-signed URL as part of the function response to API Gateway.
  6. API Gateway returns the pre-signed URL to the user as the API response.

About

Serverless application using Terraform to generate pre-signed URLs for a private S3 object with Lambda and API Gateway


Languages

Language:HCL 93.8%Language:JavaScript 6.2%