Posts

New module for public storage

New module for public storage

When you need to provide the public storage for your users, you can use this module to create a new bucket and a cloudfront distribution (make sure to use the latest version).

module "public_storage" {
  source = "../modules/cloudfront-with-s3-as-public-storage"

  context = {
    namespace = "your-namespace"
    stage     = "your-stage"
    name      = "your-name"
  }
  
  aliases         = ["example.com"]
  certificate_arn = "<CERTIFICATE_ARN>"
  bucket          = "<BUCKET_NAME>"
}

Note

This will create a new S3 bucket for you, no need to create it manually. All data is PUBLIC.