-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvariables.tf
More file actions
155 lines (136 loc) · 4.26 KB
/
variables.tf
File metadata and controls
155 lines (136 loc) · 4.26 KB
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
variable "s3_logging_hostname" {
description = "Hostname of S3-bucket to be used for logging"
type = string
default = ""
}
variable "cdn_logging" {
description = "Prefix in s3 bucket for cdn logs"
type = string
default = ""
}
variable "r53_hostname" {
description = "Hostname for CloudFront alias"
type = string
}
variable "r53_zone_id" {
description = "Route53 zone ID to be used for hostname and certificate validation"
type = string
}
variable "tags" {
description = "Map of custom tags for the provisioned resources"
type = map(string)
default = {}
}
variable "s3_origin_policy_restrict_access" {
description = "Folder/files to add as an condition to the S3-bucket policy resource"
type = string
default = "/*"
}
variable "cf_functions" {
description = <<EOT
The Cloud Front function configuration
{type = object{}} ie. {"viewer-request" = object{}}
*type:*
Allowed cf event types are viewer-request and viewer-response
*name:*
Name of the function
*comment:*
Description of the function
*code:*
Source code of the function
*assign:*
true for associating the function with the cf distribution,
false to remove the association. (to remove the cf function firstly set it
to false to dissociate from the cf distribution)
EOT
type = map(object({
name = string
comment = string
code = string
assign = bool
}))
default = {}
validation {
condition = alltrue([for type, func in var.cf_functions : contains(["viewer-request", "viewer-response"], type)])
error_message = "Only the following event types are allowed: viewer-request, viewer-response."
}
}
variable "default_root_object" {
description = "The object that you want CloudFront to return (for example, index.html) when an end user requests the root URL."
type = string
default = null
}
variable "create_origin_access_identity" {
description = "Controls if CloudFront origin access identity should be created"
type = bool
default = true
}
variable "create_origin_access_control" {
description = "Controls if CloudFront origin access control should be created"
type = bool
default = false
}
variable "additional_zones" {
description = "Map containing the Route53 Zone IDs and hostnames for additional domains"
type = map(object({
zone_id = string
hostname = string
}))
default = {}
}
variable "create" {
description = "Whether to create the resources"
type = bool
default = true
}
variable "validation_timeout" {
description = "Define maximum timeout to wait for the validation to complete"
type = string
default = null
}
variable "dns_ttl" {
description = "dns ttl for the cert validation records"
type = number
default = 60
}
variable "ipv6" {
description = "create also alias records for ipv6"
type = bool
default = false
}
variable "custom_error_response" {
description = "One or more custom error response elements"
type = list(object({
error_caching_min_ttl = optional(number)
error_code = number
response_code = optional(number)
response_page_path = optional(string)
}))
default = []
}
variable "s3_bucket_config" {
description = "S3 bucket configuration"
type = object({
create = optional(bool, true)
lifecycle_rule = optional(any, [])
bucket = string
versioning = optional(map(string), {})
control_object_ownership = optional(bool, false)
object_ownership = optional(string, "BucketOwnerPreferred")
})
}
variable "extra_cloudfront_distributions" {
description = "Extra CloudFront distributions to be associated with the S3 bucket policy"
type = list(string)
default = []
}
variable "ordered_cache_behavior" {
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."
type = any
default = []
}
variable "additional_origins" {
description = "One or more additional origins for this distribution (multiples allowed)."
type = any
default = {}
}