Skip to content

A Terraform module for creating static sites in AWS using S3 and Cloudfront

License

Notifications You must be signed in to change notification settings

keithly/cloudfront-static-site

Repository files navigation

cloudfront-static-site

A Terraform module for creating static sites in AWS using S3 and Cloudfront.

Config parameters are minimal. This module is designed for the author's use but is open to all.

Requirements

Name Version
terraform >= 1.5
aws >= 5.46.0

Providers

Name Version
aws >= 5.46.0
aws.us-east-1 >= 5.46.0

Modules

No modules.

Resources

Name Type
aws_cloudfront_distribution.site resource
aws_cloudfront_function.rewrite_and_redirect resource
aws_cloudfront_origin_access_control.site resource
aws_route53_record.site_a resource
aws_route53_record.site_a_www resource
aws_route53_record.site_aaaa resource
aws_route53_record.site_aaaa_www resource
aws_s3_bucket.cloudfront_logs resource
aws_s3_bucket.site resource
aws_s3_bucket_acl.logging resource
aws_s3_bucket_lifecycle_configuration.cf_logs resource
aws_s3_bucket_ownership_controls.logging resource
aws_s3_bucket_policy.site resource
aws_acm_certificate.site data source
aws_cloudfront_cache_policy.caching_optimized data source
aws_iam_policy_document.allow_cloudfront_oac_access data source
aws_route53_zone.site data source

Inputs

Name Description Type Default Required
bucket_name S3 bucket name string n/a yes
bucket_name_cloudfront_logs S3 bucket name for CloudFront logs string n/a yes
cloudfront_logs_expiration_days days to keep CloudFront logs number n/a yes
cloudfront_logs_prefix S3 prefix for CloudFront logs string n/a yes
domain_name Domain name of the site / existing Route53 hosted zone name string n/a yes

Outputs

No outputs.

About

A Terraform module for creating static sites in AWS using S3 and Cloudfront

Resources

License

Stars

Watchers

Forks

Packages

No packages published