Skip to content

Commit

Permalink
Fixed custom_origin_config parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
hmarsolla committed Jul 26, 2024
1 parent 1d0097d commit 9eb973f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,14 @@ 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"]
}
}
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 = {
geo_restriction = {
restriction_type = # Method that you want to use to restrict distribution of your content by country: none, whitelist, or blacklist
Expand Down Expand Up @@ -106,6 +105,12 @@ module "aws_cloudfront" {
origin = {
domain_name = example.io
origin_id = origin-resource-name
custom_origin_config {
http_port = "80"
https_port = "443"
origin_protocol_policy = "http-only"
origin_ssl_protocols = ["TLSv1", "TLSv1.1", "TLSv1.2"]
}
}
restrictions = {
Expand Down
13 changes: 6 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ resource "aws_cloudfront_distribution" "cloudfront" {
origin {
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"]
custom_origin_config {
http_port = var.origin["custom_origin_config"]["http_port"]
https_port = var.origin["custom_origin_config"]["https_port"]
origin_protocol_policy = var.origin["custom_origin_config"]["origin_protocol_policy"]
origin_ssl_protocols = var.origin["custom_origin_config"]["origin_ssl_protocols"]
}
}

restrictions {
Expand Down
4 changes: 0 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ variable "custom_error_response" {
description = ""
}

variable "custom_origin_config" {
description = ""
}

variable "zone_domain_name" {
description = ""
}
Expand Down

0 comments on commit 9eb973f

Please sign in to comment.