Skip to content

Terraform Module for creation of an S3 bucket and sets up CloudFront for seamless static web hosting.

Notifications You must be signed in to change notification settings

toomio-official/terraform-s3-cloudfront-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform S3 CloudFront Module

This Terraform module automates the creation of an S3 bucket and sets up CloudFront for static web hosting. It's designed to deploy the Toomio frontend application.

Description

This module sets up the following AWS resources:

  • AWS S3 Bucket
  • AWS CloudFront Distribution
  • AWS CloudFront Origin Access Identity
  • AWS S3 Bucket Policy
  • AWS S3 Bucket Website Configuration

Inputs

Name Description Type Default Required
s3_bucket_name Name for the S3 bucket string n/a yes
cloudfront_distribution_description Description for the CloudFront distribution string n/a yes
domain_names Domain names of the static website list(string) n/a yes
acm_certificate_arn ARN of the ACM certificate string n/a yes
index_document Name of the index document string "index.html" no

Outputs

This module currently does not define any outputs.

Notes

  • The module sets up the S3 bucket with versioning enabled and server-side encryption using AES256.
  • Public access to the S3 bucket is blocked, and access is granted only through CloudFront.
  • The CloudFront distribution is configured to use HTTPS only.
  • Custom error responses are set up for 403 and 404 errors, redirecting to the index document.
  • Some features (like custom error documents) are commented out in the current version but can be uncommented and configured if needed.

About

Terraform Module for creation of an S3 bucket and sets up CloudFront for seamless static web hosting.

Resources

Stars

Watchers

Forks

Languages