Skip to content

Commit

Permalink
PLT-0 - Allow to set origin access controls
Browse files Browse the repository at this point in the history
* fix target
  • Loading branch information
Engerim committed Dec 22, 2023
1 parent 22c08e1 commit 68b8f77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ locals {
}
}) : tomap({})

target_origin_id = var.create_origin_access_control ? "s3_origin_oac" : "s3_origin"
}

# Workaround for the input variable validation
Expand Down Expand Up @@ -96,7 +97,7 @@ module "cloudfront" {

origin = merge(local.origin_oai, local.origin_oac)
default_cache_behavior = {
target_origin_id = "s3_origin"
target_origin_id = local.target_origin_id
viewer_protocol_policy = "redirect-to-https"

allowed_methods = ["GET", "HEAD", "OPTIONS"]
Expand Down

0 comments on commit 68b8f77

Please sign in to comment.