Component 10

SSR Storage

Store built front-end assets and Lambda deployment packages in S3.

Status

Available component

Deployment scope

Primary + DR ready

Example version constraint

~> 0.2

Review published versions ↗

Usage example

Inputs in, outputs out. Illustrative wiring, not a standalone deployment.

Supply primary and DR regions and an account id. Pass the CloudFront origin access identity so the bucket policy grants the distribution read access and nobody else. Configure provider requirements and credentials in your root module; check the documentation for all required inputs and version changes.

main.tf
module "storage" {
  source  = "pomo-studio/ssr-storage/aws"
  version = "~> 0.2"

  app_name       = "my-app"
  account_id     = data.aws_caller_identity.current.account_id
  primary_region = "us-east-1"
  dr_region      = "us-west-2"
  enable_dr      = true
}

Key inputs

  • app_name
  • account_id
  • primary_region
  • dr_region
  • enable_dr

Useful outputs

  • static_assets_id
  • static_assets_regional_domain_name
  • lambda_deployments_primary_id
  • lambda_deployments_dr_id

What you get

01

Static assets bucket

Holds built front-end files, read by CloudFront through an origin access identity.

02

Deployment buckets

Holds the Lambda packages each region runs from.

03

Versioned and replicated

Versioning on everywhere; the assets bucket replicates to the DR region.

Built with

  • Amazon S3
  • CloudFront OAI
  • Replication
  • Terraform