diff --git a/README.md b/README.md index 652d93c..1bb6e3e 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,13 @@ module "aws_cloudfront" { origin = { domain_name = # DNS domain name of either the S3 bucket, or web site of your custom origin origin_id = # Unique identifier for the origin + } + + custom_origin_config { # Required when using S3 Bucket Websites + http_port = # HTTP Port for custom origin + https_port = # HTTPS Port for custom origin + origin_protocol_policy = # Protocol policy to use such as "http-only" + origin_ssl_protocols = # SSL protocols to use such as ["TLSv1", "TLSv1.1", "TLSv1.2"] } restrictions = { diff --git a/main.tf b/main.tf index eccc875..cee9a5e 100644 --- a/main.tf +++ b/main.tf @@ -35,6 +35,13 @@ resource "aws_cloudfront_distribution" "cloudfront" { domain_name = var.origin["domain_name"] origin_id = var.origin["origin_id"] } + + custom_origin_config { + http_port = var.custom_origin_config["http_port"] + https_port = var.custom_origin_config["https_port"] + origin_protocol_policy = var.custom_origin_config["origin_protocol_policy"] + origin_ssl_protocols = var.custom_origin_config["origin_ssl_protocols"] + } restrictions { geo_restriction { diff --git a/variables.tf b/variables.tf index a329011..1a417fc 100644 --- a/variables.tf +++ b/variables.tf @@ -34,6 +34,10 @@ variable "custom_error_response" { description = "" } +variable "custom_origin_config" { + description = "" +} + variable "zone_domain_name" { description = "" }