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.
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
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 |
This module currently does not define any outputs.
- 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.