Skip to content

Commit

Permalink
change origin id to be a variable for non-hugo use cases
Browse files Browse the repository at this point in the history
  • Loading branch information
fillup committed May 12, 2018
1 parent 44c2133 commit 6979078
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ resource "aws_cloudfront_distribution" "hugo" {
// supports S3 redirects with CloudFront
domain_name = "${var.bucket_name}.s3-website-${var.aws_region}.amazonaws.com"

origin_id = "hugo-s3-origin"
origin_id = "${var.s3_origin_id}"
origin_path = "/${var.origin_path}"
}

Expand All @@ -70,7 +70,7 @@ resource "aws_cloudfront_distribution" "hugo" {
default_cache_behavior {
allowed_methods = ["GET", "HEAD", "OPTIONS"]
cached_methods = ["GET", "HEAD"]
target_origin_id = "hugo-s3-origin"
target_origin_id = "${var.s3_origin_id}"

forwarded_values {
query_string = false
Expand Down
6 changes: 6 additions & 0 deletions vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@ variable "origin_path" {
type = "string"
default = "public"
}

variable "s3_origin_id" {
description = "Origin ID used in CloudFront"
type = "string"
default = "hugo-s3-origin"
}

0 comments on commit 6979078

Please sign in to comment.