terraform-aws-cloudfront-website

Terraform Module for managing AWS CloudFront Websites

APACHE-2.0 License

Stars
5

AWS: S3-backed CloudFront Distribution

This Terraform Module provisions an S3-backed CloudFront Distribution for HTTP serving.

Table of Contents

Overview

Requirements

  • Amazon Web Services (AWS) Account
  • Terraform 1.3.x or newer.

Usage

For examples, see the ./examples directory.

Inputs

Name Description Type Default Required
domain_name The Domain Name of the Route53 Zone. string n/a yes
s3_bucket_name The name of the bucket. string n/a yes
subdomain_name The Subdomain Name of the Route53 Record. string n/a yes
alternate_subdomain_names The Alternate (Sub)-Domain Names to provide to ACM and CloudFront. list(string) [] no
cloudfront_cache_policy The Identifier for a Cache Policy. string "Managed-CachingOptimized" no
cloudfront_custom_error_responses List of Custom Error Response Element Objects for the distribution. list(object({ error_caching_min_ttl = optional(number) error_code = number response_code = optional(number) response_page_path = optional(string) })) [] no
cloudfront_default_root_object The object that you want CloudFront to return when an end user requests the root URL. string "index.html" no
cloudfront_enabled Whether the distribution is enabled to accept end user requests for content. bool true no
cloudfront_http_version The maximum HTTP version to support on the distribution. string "http2and3" no
cloudfront_is_ipv6_enabled Whether the IPv6 is enabled for the distribution. bool true no
cloudfront_minimum_protocol_version The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections. string "TLSv1.2_2021" no
cloudfront_origin_request_policy The Identifier for an Origin Request Policy. string "Managed-CORS-S3Origin" no
cloudfront_price_class The price class for this distribution. string "PriceClass_100" no
cloudfront_response_headers_policy The Identifier for a Response Headers Policy. string "Managed-SimpleCORS" no
cloudfront_retain_on_delete Whether to retain (instead of delete) the CloudFront Distribution on terraform destroy. bool false no
cloudfront_ssl_support_method Specifies how you want CloudFront to serve HTTPS requests. string "sni-only" no
tags A map of tags to assign to all resources. map(string) {} no

Outputs

Name Description
aws_acm_certificate_validation Exported Attributes for module.acm_certificate.aws_acm_certificate_validation.
aws_cloudfront_distribution Exported Attributes for aws_cloudfront_distribution.
aws_route53_record Exported Attributes for aws_route53_record.main.
aws_s3_bucket Exported Attributes for aws_s3_bucket.main.
aws_s3_bucket_policy Exported Attributes for aws_s3_bucket_policy.main.
aws_s3_bucket_public_access_block Exported Attributes for aws_s3_bucket_public_access_block.main.

Author Information

This module is maintained by the contributors listed on GitHub.

License

Licensed under the Apache License, Version 2.0 (the "License").

You may obtain a copy of the License at apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, without WARRANTIES or conditions of any kind, either express or implied.

See the License for the specific language governing permissions and limitations under the License.

Related Projects