forked from cloudposse/terraform-aws-cloudfront-s3-cdn
-
Notifications
You must be signed in to change notification settings - Fork 2
/
variables.tf
316 lines (263 loc) · 9.11 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
variable "namespace" {
description = "Namespace (e.g. `eg` or `cp`)"
type = string
default = ""
}
variable "stage" {
description = "Stage (e.g. `prod`, `dev`, `staging`)"
type = string
default = ""
}
variable "name" {
description = "Name (e.g. `bastion` or `app`)"
type = string
}
variable "delimiter" {
type = string
default = "-"
description = "Delimiter to be used between `namespace`, `stage`, `name` and `attributes`"
}
variable "attributes" {
type = list(string)
default = []
description = "Additional attributes (e.g. `1`)"
}
variable "tags" {
type = map(string)
default = {}
description = "Additional tags (e.g. map(`BusinessUnit`,`XYZ`)"
}
variable "enabled" {
type = bool
default = true
description = "Select Enabled if you want CloudFront to begin processing requests as soon as the distribution is created, or select Disabled if you do not want CloudFront to begin processing requests after the distribution is created."
}
variable "acm_certificate_arn" {
type = string
description = "Existing ACM Certificate ARN"
default = ""
}
variable "minimum_protocol_version" {
type = string
description = "Cloudfront TLS minimum protocol version"
default = "TLSv1"
}
variable "aliases" {
type = list(string)
description = "List of FQDN's - Used to set the Alternate Domain Names (CNAMEs) setting on Cloudfront"
default = []
}
variable "use_regional_s3_endpoint" {
type = bool
description = "When set to 'true' the s3 origin_bucket will use the regional endpoint address instead of the global endpoint address"
default = false
}
variable "origin_bucket" {
type = string
default = ""
description = "Origin S3 bucket name"
}
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_force_destroy" {
type = bool
default = false
description = "Delete all objects from the bucket so that the bucket can be destroyed without error (e.g. `true` or `false`)"
}
variable "bucket_domain_format" {
type = string
default = "%s.s3.amazonaws.com"
description = "Format of bucket domain name"
}
variable "compress" {
type = bool
default = false
description = "Compress content for web requests that include Accept-Encoding: gzip in the request header"
}
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 "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_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" {
type = bool
default = false
description = "Forward query strings to the origin that is associated with this cache behavior"
}
variable "cors_allowed_headers" {
type = list(string)
default = ["*"]
description = "List of allowed headers for S3 bucket"
}
variable "cors_allowed_methods" {
type = list(string)
default = ["GET"]
description = "List of allowed methods (e.g. GET, PUT, POST, DELETE, HEAD) for S3 bucket"
}
variable "cors_allowed_origins" {
type = list(string)
default = []
description = "List of allowed origins (e.g. example.com, test.com) for S3 bucket"
}
variable "cors_expose_headers" {
type = list(string)
default = ["ETag"]
description = "List of expose header in the response for S3 bucket"
}
variable "cors_max_age_seconds" {
default = 3600
description = "Time in seconds that browser can cache the response for S3 bucket"
}
variable "forward_cookies" {
type = string
default = "none"
description = "Time in seconds that browser can cache the response for S3 bucket"
}
variable "forward_header_values" {
type = list(string)
description = "A list of whitelisted header values to forward to the origin"
default = ["Access-Control-Request-Headers", "Access-Control-Request-Method", "Origin"]
}
variable "price_class" {
type = string
default = "PriceClass_100"
description = "Price class for this distribution: `PriceClass_All`, `PriceClass_200`, `PriceClass_100`"
}
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" {
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 "trusted_signers" {
type = list(string)
default = []
description = "The AWS accounts, if any, that you want to allow to create signed URLs for private content. 'self' is acceptable."
}
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`"
type = string
}
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 "null" {
description = "an empty string"
default = ""
}
variable "static_s3_bucket" {
type = string
default = "aws-cli"
description = <<DOC
aws-cli is a bucket owned by amazon that will perminantly exist.
It allows for the data source to be called during the destruction process without failing.
It doesn't get used for anything else, this is a safe workaround for handling the fact that
if a data source like the one `aws_s3_bucket.selected` gets an error, you can't continue the terraform process
which also includes the 'destroy' command, where is doesn't even need this data source!
Don't change this bucket name, it's a variable so that we can provide this description.
And this works around a problem that is an edge case.
DOC
}
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 "lambda_function_association" {
type = list(object({
event_type = string
include_body = bool
lambda_arn = string
}))
description = "A config block that triggers a lambda function with specific actions"
default = []
}
variable "web_acl_id" {
type = string
default = ""
description = "ID of the AWS WAF web ACL that is associated with the distribution"
}
variable "wait_for_deployment" {
type = bool
default = true
description = "When set to 'true' the resource will wait for the distribution status to change from InProgress to Deployed"
}