-
-
Notifications
You must be signed in to change notification settings - Fork 121
/
variables.tf
274 lines (224 loc) · 8.52 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
variable "region" {
type = string
description = "AWS region"
}
variable "dns_aliases_enabled" {
default = "true"
description = "Set to false to prevent dns records for aliases from being created"
}
variable "acm_certificate_arn" {
description = "Existing ACM Certificate ARN"
default = ""
}
variable "aliases" {
type = list(string)
default = []
description = "List of aliases. CAUTION! Names MUSTN'T contain trailing `.`"
}
variable "custom_error_response" {
# http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html#custom-error-pages-procedure
# https://www.terraform.io/docs/providers/aws/r/cloudfront_distribution.html#custom-error-response-arguments
type = list(object({
error_caching_min_ttl = string
error_code = string
response_code = string
response_page_path = string
}))
description = "List of one or more custom error response element maps"
default = []
}
variable "custom_header" {
type = list(object({
name = string
value = string
}))
description = "List of one or more custom headers passed to the origin"
default = []
}
variable "web_acl_id" {
description = "(Optional) - Web ACL ID that can be attached to the Cloudfront distribution"
default = ""
}
variable "origin_domain_name" {
description = "(Required) - The DNS domain name of your custom origin (e.g. website)"
default = ""
}
variable "origin_path" {
description = "(Optional) - An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin"
default = ""
}
variable "origin_http_port" {
description = "(Required) - The HTTP port the custom origin listens on"
default = "80"
}
variable "origin_https_port" {
description = "(Required) - The HTTPS port the custom origin listens on"
default = "443"
}
variable "origin_protocol_policy" {
description = "(Required) - The origin protocol policy to apply to your origin. One of http-only, https-only, or match-viewer"
default = "match-viewer"
}
variable "origin_ssl_protocols" {
description = "(Required) - The SSL/TLS protocols that you want CloudFront to use when communicating with your origin over HTTPS"
type = list(string)
default = ["TLSv1", "TLSv1.1", "TLSv1.2"]
}
variable "origin_keepalive_timeout" {
description = "(Optional) The Custom KeepAlive timeout, in seconds. By default, AWS enforces a limit of 60. But you can request an increase."
default = "60"
}
variable "origin_read_timeout" {
description = "(Optional) The Custom Read timeout, in seconds. By default, AWS enforces a limit of 60. But you can request an increase."
default = "60"
}
variable "compress" {
description = "(Optional) Whether you want CloudFront to automatically compress content for web requests that include Accept-Encoding: gzip in the request header (default: false)"
default = "false"
}
variable "is_ipv6_enabled" {
default = "true"
description = "State of CloudFront IPv6"
}
variable "default_root_object" {
default = "index.html"
description = "Object that CloudFront return when requests the root URL"
}
variable "comment" {
default = "Managed by Terraform"
description = "Comment for the origin access identity"
}
variable "logging_enabled" {
type = bool
default = true
description = "When true, access logs will be sent to a newly created S3 bucket or bucket specified by log_bucket_fqdn"
}
variable "log_include_cookies" {
default = "false"
description = "Include cookies in access logs"
}
variable "log_prefix" {
default = ""
description = "Path of logs in S3 bucket"
}
variable "log_standard_transition_days" {
description = "Number of days to persist in the standard storage tier before moving to the glacier tier"
default = "30"
}
variable "log_glacier_transition_days" {
description = "Number of days after which to move the data to the glacier storage tier"
default = "60"
}
variable "log_expiration_days" {
description = "Number of days after which to expunge the objects"
default = "90"
}
variable "forward_query_string" {
default = "false"
description = "Forward query strings to the origin that is associated with this cache behavior"
}
variable "forward_headers" {
description = "Specifies the Headers, if any, that you want CloudFront to vary upon for this cache behavior. Specify `*` to include all headers."
type = list(string)
default = []
}
variable "forward_cookies" {
description = "Specifies whether you want CloudFront to forward cookies to the origin. Valid options are all, none or whitelist"
default = "whitelist"
}
variable "forward_cookies_whitelisted_names" {
type = list(string)
description = "List of forwarded cookie names"
default = []
}
variable "price_class" {
default = "PriceClass_100"
description = "Price class for this distribution: `PriceClass_All`, `PriceClass_200`, `PriceClass_100`"
}
variable "viewer_minimum_protocol_version" {
description = "(Optional) The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections."
default = "TLSv1"
}
variable "viewer_protocol_policy" {
description = "allow-all, redirect-to-https"
default = "redirect-to-https"
}
variable "allowed_methods" {
type = list(string)
default = ["DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"]
description = "List of allowed methods (e.g. ` GET, PUT, POST, DELETE, HEAD`) for AWS CloudFront"
}
variable "cached_methods" {
type = list(string)
default = ["GET", "HEAD"]
description = "List of cached methods (e.g. ` GET, PUT, POST, DELETE, HEAD`)"
}
variable "default_ttl" {
default = "60"
description = "Default amount of time (in seconds) that an object is in a CloudFront cache"
}
variable "min_ttl" {
default = "0"
description = "Minimum amount of time that you want objects to stay in CloudFront caches"
}
variable "max_ttl" {
default = "31536000"
description = "Maximum amount of time (in seconds) that an object is in a CloudFront cache"
}
variable "geo_restriction_type" {
# e.g. "whitelist"
default = "none"
description = "Method that use to restrict distribution of your content by country: `none`, `whitelist`, or `blacklist`"
}
variable "geo_restriction_locations" {
type = list(string)
# e.g. ["US", "CA", "GB", "DE"]
default = []
description = "List of country codes for which CloudFront either to distribute content (whitelist) or not distribute your content (blacklist)"
}
variable "parent_zone_id" {
default = ""
description = " ID of the hosted zone to contain this record (or specify `parent_zone_name`)"
}
variable "parent_zone_name" {
default = ""
description = "Name of the hosted zone to contain this record (or specify `parent_zone_id`)"
}
variable "ordered_cache" {
type = list(object({
target_origin_id = string
path_pattern = string
allowed_methods = list(string)
cached_methods = list(string)
compress = bool
viewer_protocol_policy = string
min_ttl = number
default_ttl = number
max_ttl = number
forward_query_string = bool
forward_header_values = list(string)
forward_cookies = string
lambda_function_association = list(object({
event_type = string
include_body = bool
lambda_arn = string
}))
}))
default = []
description = <<DESCRIPTION
An ordered list of cache behaviors resource for this distribution. List from top to bottom in order of precedence. The topmost cache behavior will have precedence 0.
The fields can be described by the other variables in this file. For example, the field 'lambda_function_association' in this object has
a description in var.lambda_function_association variable earlier in this file. The only difference is that fields on this object are in ordered caches, whereas the rest
of the vars in this file apply only to the default cache. Put value `""` on field `target_origin_id` to specify default s3 bucket origin.
DESCRIPTION
}
variable "trusted_signers" {
type = list(string)
default = []
description = "List of AWS account IDs (or self) that you want to allow to create signed URLs for private content"
}
variable "http_version" {
type = string
default = "http2"
description = "The maximum HTTP version to support on the distribution. Allowed values are http1.1, http2, http2and3 and http3."
}