-
Notifications
You must be signed in to change notification settings - Fork 3
/
variables.tf
222 lines (187 loc) · 6.23 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
// R53
variable "r53_zone_name" {
type = string
description = "Name of the public hosted zone, this is used for creating the A record for the CloudFront distro."
}
variable "domain" {
type = string
description = "Domain name to use for the CloudFront distribution."
}
// CloudFront distribution
variable "custom_origin_mappings" {
type = map(object({
origin_id = string
domain_name = string
}))
default = {}
description = "Custom origin mappings. Can be used in conjunction with S3 origin mappings Defaults to an empty map."
}
variable "s3_origin_mappings" {
type = map(object({
origin_id = string
domain_name = string
origin_access_control_id = string
}))
default = {}
description = "S3 origin mappings. Can be used in conjunction with custom origin mappings Defaults to an empty map."
}
variable "default_cache_behavior" {
type = object({
origin_id = string
domain_name = string
static_backend = bool
allowed_methods = list(string)
})
description = "Default cache behaviour used by the distro, if a backend is static no query strings or cookies are forwarded."
}
variable "aliases" {
type = list(string)
description = "Aliases used by the CloudFront distribution."
default = []
}
variable "default_root_object" {
type = string
default = "index.html"
description = "Default root object for the CloudFront distribution, this defaults to 'index.html'."
}
variable "viewer_protocol_policy" {
type = string
default = "redirect-to-https"
description = "Default viewer_protocol_policy for the CloudFront distribution, this defaults to 'redirect-to-https'."
}
variable "origin_protocol_policy" {
type = string
default = "https-only"
description = "Default origin_protocol_policy for the CloudFront distribution, this defaults to 'https-only'."
}
variable "acm_cert_arn" {
type = string
description = "AWS ACM certificate ARN to use for the CloudFront distribution."
}
variable "enable_access_logs" {
type = bool
default = false
description = "Should accesses to the CloudFront distribution be logged, defaults to false."
}
variable "log_cookies" {
type = bool
default = false
description = "If access logs are enabled, are cookies logged."
}
variable "access_logs_bucket" {
type = string
default = ""
description = "If access logs are enabled the bucket the logs should go into, defaults to false."
}
variable "wait_for_deployment" {
type = bool
default = true
description = "Specifies if Terrafrom should wait for deployments to complete before returning. Defaults to true."
}
variable "cached_methods" {
type = list(string)
default = ["GET", "HEAD"]
description = "HTTP methods the CloudFront distribution will cache, defaults to GET and HEAD."
}
variable "min_ttl" {
type = number
default = 0
description = "Minimum TTL of objects in the cache. Defaults to 0."
}
variable "default_ttl" {
type = number
default = 3600
description = "Default TTL of objects in the cache. Set to 0 if you wish to disable caching. Defaults to 3600."
}
variable "max_ttl" {
type = number
default = 86400
description = "Maximum TTL of objects in the cache. Set to 0 if you wish to disable caching. Defaults to 3600."
}
variable "geo_restriction_type" {
type = string
default = "none"
description = "The method that you want to use to restrict distribution of your content by country: 'none', 'whitelist', or 'blacklist'. Defaults to none."
}
variable "geo_restriction_locations" {
type = list(string)
default = []
description = "The ISO 3166-1-alpha-2 codes for which you want CloudFront either to allow or disallow content delivery."
}
//EDGE LAMBDA
variable "enable_custom_lambda" {
type = bool
description = "Flag to allow creation of a custom edge lambda. If set to false the following - edge lambda related variables - will be optional."
default = true
}
variable "lambda_dist_dir" {
type = string
description = "Directory of the lambda distribution which is to be published"
default = ""
}
variable "lambda_runtime" {
type = string
description = "The runtime of the lambda"
default = ""
}
variable "lambda_name_prefix" {
type = string
description = "Name prefix to be given to the Lambda."
default = ""
}
variable "lambda_handler" {
type = string
description = "The lambda entry point"
default = ""
}
variable "lambda_memory_size" {
type = string
description = "How much memory to give the lambda"
default = "128"
}
variable "lambda_cf_event_type" {
type = string
description = "When to trigger the Lambda: 'viewer-request', 'origin-request', 'viewer-response', 'origin-response'."
default = ""
}
variable "lambda_cf_include_body" {
type = bool
description = "When set to true it exposes the request body to the lambda function."
default = false
}
// TAGGING
variable "namespace" {
type = string
description = "The namespace of the distribution."
}
variable "aws_region" {
type = string
description = "The region to deploy the lambda into."
}
variable "stage" {
type = string
description = "The stage of the distribution - (dev, staging etc)."
}
variable "name" {
type = string
description = "The name of the distribution."
}
variable "tags" {
type = map(any)
description = "Tags applied to the distribution, these should follow what is defined [here](https://github.com/Adaptavist/terraform-compliance/blob/master/features/tags.feature)."
}
variable "hsts_lambda_timeout" {
type = string
default = "15"
description = "The lambda time out applied to the hsts edge lambda, this timeout includes the time taken for the origin to respond"
}
variable "enable_hsts_lambda" {
type = bool
default = false
description = "Whether to deploy the edge lambda that adds in an HSTS header on response"
}
variable "origin_read_timeout" {
type = number
default = 30
description = "The Custom Read timeout, in seconds. By default, AWS enforces a limit of 60"
}