-
-
Notifications
You must be signed in to change notification settings - Fork 121
/
variables.tf
424 lines (358 loc) · 13.1 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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
variable "distribution_enabled" {
type = bool
default = true
description = "Set to `true` if you want CloudFront to begin processing requests as soon as the distribution is created, or to false if you do not want CloudFront to begin processing requests after the distribution is created."
}
variable "dns_aliases_enabled" {
type = bool
default = true
description = "Set to false to prevent dns records for aliases from being created"
}
variable "acm_certificate_arn" {
type = string
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" {
type = string
description = "ID of the AWS WAF web ACL that is associated with the distribution"
default = ""
}
variable "origin_domain_name" {
type = string
description = "The DNS domain name of your custom origin (e.g. website)"
default = ""
}
variable "origin_path" {
# http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesOriginPath
type = string
description = "An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin. It must begin with a /. Do not add a / at the end of the path."
default = ""
}
variable "origin_access_control_id" {
# https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html
type = string
description = "CloudFront provides two ways to send authenticated requests to an Amazon S3 origin: origin access control (OAC) and origin access identity (OAI). OAC helps you secure your origins, such as for Amazon S3."
default = null
}
variable "origin_http_port" {
type = number
description = "The HTTP port the custom origin listens on"
default = "80"
}
variable "origin_https_port" {
type = number
description = "The HTTPS port the custom origin listens on"
default = 443
}
variable "origin_protocol_policy" {
type = string
description = "The origin protocol policy to apply to your origin. One of http-only, https-only, or match-viewer"
default = "match-viewer"
}
variable "origin_shield" {
type = object({
enabled = bool
region = string
})
description = "The CloudFront Origin Shield settings"
default = null
}
variable "origin_ssl_protocols" {
description = "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" {
type = number
description = "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" {
type = number
description = "The Custom Read timeout, in seconds. By default, AWS enforces a limit of 60. But you can request an increase."
default = 60
}
variable "compress" {
type = bool
description = "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" {
type = bool
default = true
description = "State of CloudFront IPv6"
}
variable "default_root_object" {
type = string
default = "index.html"
description = "Object that CloudFront return when requests the root URL"
}
variable "comment" {
type = string
default = "Managed by Terraform"
description = "Comment for the origin access identity"
}
variable "origin_access_identity_enabled" {
type = bool
default = true
description = "When true, creates origin access identity resource"
}
variable "logging_enabled" {
type = bool
default = true
description = "When true, access logs will be sent to a newly created s3 bucket"
}
variable "log_include_cookies" {
type = bool
default = false
description = "Include cookies in access logs"
}
variable "log_prefix" {
type = string
default = ""
description = "Path of logs in S3 bucket"
}
variable "log_bucket_fqdn" {
type = string
default = ""
description = "Optional fqdn of logging bucket, if not supplied a bucket will be generated."
}
variable "log_force_destroy" {
type = bool
description = "Applies to log bucket created by this module only. If true, all objects will be deleted from the bucket on destroy, so that the bucket can be destroyed without error. These objects are not recoverable."
default = false
}
variable "log_standard_transition_days" {
type = number
description = "Number of days to persist in the standard storage tier before moving to the glacier tier"
default = 30
}
variable "log_glacier_transition_days" {
type = number
description = "Number of days after which to move the data to the glacier storage tier"
default = 60
}
variable "log_expiration_days" {
type = number
description = "Number of days after which to expunge the objects"
default = 90
}
variable "forward_query_string" {
type = bool
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" {
type = string
description = "Specifies whether you want CloudFront to forward cookies to the origin. Valid options are all, none or whitelist"
default = "none"
}
variable "forward_cookies_whitelisted_names" {
type = list(string)
description = "List of forwarded cookie names"
default = []
}
variable "price_class" {
type = string
default = "PriceClass_100"
description = "Price class for this distribution: `PriceClass_All`, `PriceClass_200`, `PriceClass_100`"
}
variable "viewer_minimum_protocol_version" {
type = string
description = "The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections. This is ignored if the default CloudFront certificate is used."
default = "TLSv1.2_2021"
}
variable "viewer_protocol_policy" {
type = string
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 "cache_policy_id" {
type = string
default = null
description = "ID of the cache policy attached to the cache behavior"
}
variable "origin_request_policy_id" {
type = string
default = null
description = "ID of the origin request policy attached to the cache behavior"
}
variable "response_headers_policy_id" {
type = string
description = "The identifier for a response headers policy"
default = ""
}
variable "default_ttl" {
type = number
default = 60
description = "Default amount of time (in seconds) that an object is in a CloudFront cache"
}
variable "min_ttl" {
type = number
default = 0
description = "Minimum amount of time that you want objects to stay in CloudFront caches"
}
variable "max_ttl" {
type = number
default = 31536000
description = "Maximum amount of time (in seconds) that an object is in a CloudFront cache"
}
variable "geo_restriction_type" {
# e.g. "whitelist"
type = string
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" {
type = string
default = ""
description = "ID of the hosted zone to contain this record (or specify `parent_zone_name`)"
}
variable "parent_zone_name" {
type = string
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)
cache_policy_id = string
origin_request_policy_id = 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
response_headers_policy_id = string
lambda_function_association = list(object({
event_type = string
include_body = bool
lambda_arn = string
}))
function_association = list(object({
event_type = string
function_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 "custom_origins" {
type = list(object({
domain_name = string
origin_id = string
origin_path = string
origin_access_control_id = string
custom_headers = list(object({
name = string
value = string
}))
custom_origin_config = object({
http_port = number
https_port = number
origin_protocol_policy = string
origin_ssl_protocols = list(string)
origin_keepalive_timeout = number
origin_read_timeout = number
})
s3_origin_config = object({
origin_access_identity = string
})
}))
default = []
description = "One or more custom origins for this distribution (multiples allowed). See documentation for configuration options description https://www.terraform.io/docs/providers/aws/r/cloudfront_distribution.html#origin-arguments"
}
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 "lambda_function_association" {
type = list(object({
event_type = string
include_body = bool
lambda_arn = string
}))
description = "A config block that triggers a Lambda@Edge function with specific actions"
default = []
}
variable "function_association" {
type = list(object({
event_type = string
function_arn = string
}))
description = <<-EOT
A config block that triggers a CloudFront function with specific actions.
See the [aws_cloudfront_distribution](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudfront_distribution#function-association)
documentation for more information.
EOT
default = []
}
variable "realtime_log_config_arn" {
type = string
default = null
description = "The ARN of the real-time log configuration that is attached to this cache behavior"
}
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."
}