-
Notifications
You must be signed in to change notification settings - Fork 3
/
variables.tf
132 lines (115 loc) · 3.34 KB
/
variables.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
variable "s3_origin_hostname" {
description = "Hostname of S3-bucket to be used as origin"
type = string
default = ""
}
variable "s3_origin_name" {
description = "Name of S3-bucket to be used as origin"
type = string
default = ""
}
variable "s3_logging_hostname" {
description = "Hostname of S3-bucket to be used for logging"
type = string
default = ""
}
variable "cdn_logging" {
description = "Prefix in s3 bucket for cdn logs"
type = string
default = ""
}
variable "r53_hostname" {
description = "Hostname for CloudFront alias"
type = string
}
variable "r53_zone_id" {
description = "Route53 zone ID to be used for hostname and certificate validation"
type = string
}
variable "tags" {
description = "Map of custom tags for the provisioned resources"
type = map(string)
default = {}
}
variable "override_s3_origin_policy" {
description = "Overrides the S3-bucket policy to set OAI"
type = bool
default = false
}
variable "s3_origin_policy_restrict_access" {
description = "Folder/files to add as an condition to the S3-bucket policy resource"
type = string
default = "/*"
}
variable "cf_functions" {
description = <<EOT
The Cloud Front function configuration
{type = object{}} ie. {"viewer-request" = object{}}
*type:*
Allowed cf event types are viewer-request and viewer-response
*name:*
Name of the function
*comment:*
Description of the function
*code:*
Source code of the function
*assign:*
true for associating the function with the cf distribution,
false to remove the association. (to remove the cf function firstly set it
to false to dissociate from the cf distribution)
EOT
type = map(object({
name = string
comment = string
code = string
assign = bool
}))
default = {}
validation {
condition = alltrue([for type, func in var.cf_functions : contains(["viewer-request", "viewer-response"], type)])
error_message = "Only the following event types are allowed: viewer-request, viewer-response."
}
}
variable "default_root_object" {
description = "The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL."
type = string
default = null
}
variable "create_origin_access_identity" {
description = "Controls if CloudFront origin access identity should be created"
type = bool
default = true
}
variable "create_origin_access_control" {
description = "Controls if CloudFront origin access control should be created"
type = bool
default = false
}
variable "additional_zones" {
description = "Map containing the Route53 Zone IDs and hostnames for additional domains"
type = map(object({
zone_id = string
hostname = string
}))
default = {}
}
variable "create" {
description = "Whether to create the resources"
type = bool
default = true
}
variable "validation_timeout" {
description = "Define maximum timeout to wait for the validation to complete"
type = string
default = null
}
variable "dns_ttl" {
description = "dns ttl for the cert validation records"
type = number
default = 60
}
variable "ipv6" {
description = "create also alias records for ipv6"
type = bool
default = false
}