Skip to content

Commit

Permalink
Merge pull request #6 from osodevops/MrDevopsman-patch-1
Browse files Browse the repository at this point in the history
Update module_s3_bucket_cloudfront_logging.tf
  • Loading branch information
MrDevopsman authored Oct 15, 2024
2 parents 8ceba33 + bbd2502 commit 4098579
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions module_s3_bucket_cloudfront_logging.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ module "bucket_cloudwatch_logs_backup" {
bucket = local.logging_bucket_name
force_destroy = false
tags = var.common_tags
acl = var.whitelabel_domain ? null : "private"
acl = var.whitelabel_domain || var.acl_disabled ? null : "private"
object_ownership = "ObjectWriter"
control_object_ownership = var.whitelabel_domain ? true : false
control_object_ownership = var.whitelabel_domain || var.owner_enabled ? true : false
attach_access_log_delivery_policy = var.whitelabel_domain ? true : false

# Bucket public access
Expand Down
14 changes: 13 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,18 @@ variable "whitelabel_domain" {
default = false
}

variable "acl_disabled" {
description = "Boolean flag to disable ACL"
type = bool
default = true
}

variable "owner_enabled" {
description = "Boolean flag to enable owner controlled"
type = bool
default = true
}

variable "common_tags" {
type = map(string)
description = "Implements the common tags."
Expand All @@ -141,4 +153,4 @@ variable "common_tags" {
locals {
logging_bucket_name = "${var.distribution_name}-cf-logs-${data.aws_region.current.name}-${lower(data.aws_iam_account_alias.current.account_alias)}"
shared_origin_path = var.shared_origin_access_identity != "" ? var.shared_origin_access_identity : aws_cloudfront_origin_access_identity.current[0].cloudfront_access_identity_path
}
}

0 comments on commit 4098579

Please sign in to comment.