Skip to content

Commit b3f050d

Browse files
[PRMP-579] attempt to fix logging_config error
1 parent 01d336a commit b3f050d

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

infrastructure/cloudfront.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ module "cloudfront-distribution-lg" {
1919
secondary_bucket_domain_name = module.ndr-document-pending-review-store.bucket_regional_domain_name
2020
secondary_bucket_id = module.ndr-document-pending-review-store.bucket_id
2121
secondary_bucket_path_pattern = "/review/*"
22+
log_bucket_id = local.access_logs_bucket_id
2223
}

infrastructure/modules/cloudfront/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ resource "aws_cloudfront_distribution" "distribution_with_secondary_bucket" {
9898

9999
}
100100

101+
logging_config {
102+
bucket = var.log_bucket_id
103+
# this might break it as path pattern is in format /pattern/
104+
prefix = var.secondary_bucket_path_pattern
105+
}
106+
101107
viewer_certificate {
102108
cloudfront_default_certificate = true
103109
}

infrastructure/modules/cloudfront/variable.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,8 @@ variable "secondary_bucket_path_pattern" {
3939
type = string
4040
}
4141

42+
variable "log_bucket_id" {
43+
description = "The bucket ID to send access logs to"
44+
type = string
45+
}
46+

0 commit comments

Comments
 (0)