forked from cloudposse/terraform-aws-cloudfront-cdn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
306 lines (256 loc) · 9.37 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
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_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_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 "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_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."
default = "TLSv1"
}
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 "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)
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"
}