A Terraform Module for building the infrastructure to host a static website. The following will be deployed:
- S3 Bucket
- CloudFront Distribution
- Route53 DNS
- TLS/SSL Certificate
Name | Version |
---|---|
terraform | >= 1.0 |
aws | ~> 4.0 |
random | ~> 3.0 |
Name | Version |
---|---|
aws | ~> 4.0 |
random | ~> 3.0 |
Name | Type |
---|---|
aws_acm_certificate.default | resource |
aws_acm_certificate_validation.default | resource |
aws_cloudfront_distribution.s3_distribution | resource |
aws_cloudfront_origin_access_identity.default | resource |
aws_route53_record.aliases | resource |
aws_route53_record.default | resource |
aws_route53_record.validation | resource |
aws_route53_zone.default | resource |
aws_s3_bucket.default | resource |
aws_s3_bucket_acl.default | resource |
aws_s3_bucket_policy.allow_cloudfront_access | resource |
aws_s3_bucket_public_access_block.default | resource |
aws_s3_bucket_server_side_encryption_configuration.default | resource |
aws_s3_bucket_versioning.default | resource |
aws_s3_bucket_website_configuration.default | resource |
random_id.uniq | resource |
aws_iam_policy_document.bucket_policy | data source |
aws_route53_zone.default | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
aliases | Additional domain aliases to add to the CloudFront distribution | list(string) |
[] |
no |
cloudfront_price_class | The PriceClass for CloudFront distribution | string |
"PriceClass_100" |
no |
force_destroy | The force_destroy argument of the S3 bucket | bool |
true |
no |
fqdn | The primary FQDN of the website and also name of the S3 bucket | string |
n/a | yes |
index_document | The HTML file to use as the index document | string |
"index.html" |
no |
tags | A key/value map to use for tagging resources | map(string) |
{} |
no |
use_existing_route53_zone | A boolean representing whether to use an existing Route53 domain | bool |
true |
no |
Name | Description |
---|---|
cloudfront_distribution | CloudFront Distribution ID |
s3_bucket_name | S3 Bucket Name |