forked from cesarpball/terraform-aws-cloudfront
-
Notifications
You must be signed in to change notification settings - Fork 0
/
locals.tf
34 lines (30 loc) · 1.32 KB
/
locals.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Logging config enabled
locals {
cloudfront_logging_configs = {
enabled = [{
bucket = var.logging_config["bucket"]
include_cookies = var.logging_config["include_cookies"]
prefix = var.logging_config["prefix"]
}]
disabled = []
}
enable_logging = var.cloudfront_logging_enabled == true ? "enabled" : "disabled"
}
# Certificate
locals {
acm_certificate_arn_configs = {
acm_certificate_arn_enable = [{
acm_certificate_arn = var.acm_certificate_arn_config["acm_certificate_arn"]
minimum_protocol_version = var.acm_certificate_arn_config["minimum_protocol_version"]
ssl_support_method = var.acm_certificate_arn_config["ssl_support_method"]
cloudfront_default_certificate = false
}]
acm_certificate_arn_disable = [{
cloudfront_default_certificate = var.cloudfront_default_certificate
acm_certificate_arn = var.acm_certificate_arn_config["acm_certificate_arn"]
minimum_protocol_version = var.acm_certificate_arn_config["minimum_protocol_version"]
ssl_support_method = var.acm_certificate_arn_config["ssl_support_method"]
}]
}
enable_certificate = var.acm_certificate_arn_config["acm_certificate_arn"] != null ? "acm_certificate_arn_enable" : "acm_certificate_arn_disable"
}