File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ module "static-site" {
128128| <a name =" input_gitlab_environment " ></a > [ gitlab\_ environment] ( #input\_ gitlab\_ environment ) | n/a | ` string ` | ` "*" ` | no |
129129| <a name =" input_gitlab_project_id " ></a > [ gitlab\_ project\_ id] ( #input\_ gitlab\_ project\_ id ) | n/a | ` string ` | ` null ` | no |
130130| <a name =" input_logs_bucket " ></a > [ logs\_ bucket] ( #input\_ logs\_ bucket ) | n/a | ` string ` | ` null ` | no |
131+ | <a name =" input_logs_bucket_domain_name " ></a > [ logs\_ bucket\_ domain\_ name] ( #input\_ logs\_ bucket\_ domain\_ name ) | n/a | ` string ` | ` null ` | no |
131132| <a name =" input_override_status_code_403 " ></a > [ override\_ status\_ code\_ 403] ( #input\_ override\_ status\_ code\_ 403 ) | n/a | ` number ` | ` 403 ` | no |
132133| <a name =" input_override_status_code_404 " ></a > [ override\_ status\_ code\_ 404] ( #input\_ override\_ status\_ code\_ 404 ) | n/a | ` number ` | ` 200 ` | no |
133134| <a name =" input_proxy_paths " ></a > [ proxy\_ paths] ( #input\_ proxy\_ paths ) | n/a | <pre >list(object({<br > origin_domain = string<br > path_prefix = string<br > }))</pre > | ` [] ` | no |
Original file line number Diff line number Diff line change @@ -186,6 +186,16 @@ resource "aws_cloudfront_distribution" "this" {
186186 minimum_protocol_version = " TLSv1.2_2018"
187187 }
188188
189+ dynamic "logging_config" {
190+ for_each = var. logs_bucket_domain_name == null ? [] : [1 ]
191+
192+ content {
193+ bucket = var. logs_bucket_domain_name
194+ prefix = " cloudfront/access_logs/${ local . main_domain_sanitized } /"
195+ include_cookies = false
196+ }
197+ }
198+
189199 tags = local. tags
190200}
191201
Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ variable "logs_bucket" {
3131 default = null
3232}
3333
34+ variable "logs_bucket_domain_name" {
35+ type = string
36+ default = null
37+ }
38+
3439variable "cloudfront_price_class" {
3540 type = string
3641 default = " PriceClass_100"
You can’t perform that action at this time.
0 commit comments