Skip to content

Commit

Permalink
Parameterise S3 origin access key (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
lawliet89 authored Apr 2, 2024
1 parent 55288a4 commit c8c75f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cloudfront.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module "cdn" {
origin_access_control = {
domain_name = module.s3.s3_bucket_bucket_regional_domain_name
origin_path = ""
origin_access_control = "s3" # key in `origin_access_control`
origin_access_control = var.s3_origin_access_control_key # key in `origin_access_control`
origin_shield = {
enabled = true
origin_shield_region = data.aws_region.current.name
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ variable "origin_access_control" {
}
}

variable "s3_origin_access_control_key" {
description = "Key in `origin_access_control` to use for S3 origin access control"
type = string
default = "s3"
}

variable "origin" {
description = "One or more origins for this distribution (multiples allowed)."
type = any
Expand Down

0 comments on commit c8c75f5

Please sign in to comment.