/lambda-image-viewer

A simple image viewer

Primary LanguageGoMIT LicenseMIT

lambda-image-viewer

A simple image viewer using AWS Lambda + CloudFront + DynamoDB + S3.

Diagram

Features

Screenshot

  • No ALB or API Gateway. The viewer uses Lambda Function URLs.
  • The viewer shows some EXIFs from DynamoDB.
  • S3-event-driven Tagger gets EXIF by a photo and puts to DynamoDB.
  • CloudFront delivery.

DynamoDB item example

Requirements

  • Serverless Framework v3.34
  • Terraform v1.5.0
  • Go 1.21
  • AWS

You can also use **env to install easily.

Usage

Clone

git clone https://github.com/tsubasaogawa/lambda-image-viewer.git

Fix environments

cd lambda-image-viewer

cp -p src/viewer/.env.tmpl src/viewer/.env
vim src/viewer/.env

cp -p terraform/terraform.tfvars.tmpl terraform/terraform.tfvars
vim terraform/terraform.tfvars

Deploy Lambda

cd src/viewer

serverless deploy
# Building go binary, deploying lambda using serverless

Deploy instastructure

cd ../../terraform

terraform init
terraform apply

Upload photo

aws s3 cp <PHOTO FILE> s3://<CREATED S3 BUCKET>/<FILE NAME>

Future Works

  • Fix design