generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvariables.tf
208 lines (198 loc) · 6.77 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
variable "account_number" {
type = string
description = "Account number of current environment"
}
variable "tags" {
type = map(string)
description = "Common tags to be used by all resources"
}
variable "application_name" {
type = string
description = "Name of application"
}
variable "public_subnets" {
type = list(string)
description = "Badly named variable, use subnets instead. Keeping for backward compatibility"
default = []
}
variable "subnets" {
type = list(string)
description = "List of subnet IDs. Typically use private subnet for internal LBs and public for public LBs"
default = []
}
variable "loadbalancer_ingress_rules" {
description = "Create new security group with these ingress rules for the loadbalancer. Or use the security_groups var to attach existing group(s)"
type = map(object({
description = string
from_port = number
to_port = number
protocol = string
security_groups = list(string)
cidr_blocks = list(string)
}))
default = {}
}
variable "loadbalancer_egress_rules" {
description = "Create new security group with these egress rules for the loadbalancer. Or use the security_groups var to attach existing group(s)"
type = map(object({
description = string
from_port = number
to_port = number
protocol = string
security_groups = list(string)
cidr_blocks = list(string)
}))
default = {}
}
variable "security_groups" {
description = "List of existing security group ids to attach to the load balancer. You can use this instead of loadbalancer_ingress_rules,loadbalancer_egress_rules vars"
type = list(string)
default = null
}
variable "vpc_all" {
type = string
description = "The full name of the VPC (including environment) used to create resources"
}
variable "enable_deletion_protection" {
type = bool
description = "If true, deletion of the load balancer will be disabled via the AWS API. This will prevent Terraform from deleting the load balancer."
}
variable "region" {
type = string
description = "AWS Region where resources are to be created"
}
variable "idle_timeout" {
type = string
description = "The time in seconds that the connection is allowed to be idle."
default = null
}
variable "existing_bucket_name" {
type = string
default = ""
description = "The name of the existing bucket name. If no bucket is provided one will be created for them."
}
variable "force_destroy_bucket" {
type = bool
description = "A boolean that indicates all objects (including any locked objects) should be deleted from the bucket so that the bucket can be destroyed without error. These objects are not recoverable."
default = false
}
variable "internal_lb" {
type = bool
description = "A boolean that determines whether the load balancer is internal or internet-facing."
default = false
}
variable "load_balancer_type" {
type = string
description = "application or network"
default = "application"
}
variable "access_logs" {
type = bool
description = "A boolean that determines whether to have access logs"
default = true
}
variable "s3_versioning" {
type = bool
description = "A boolean that determines whether s3 will have versioning"
default = true
}
variable "lb_target_groups" {
description = "Map of load balancer target groups, where key is the name"
type = map(object({
port = optional(number)
attachment_port = optional(number)
deregistration_delay = optional(number)
health_check = optional(object({
enabled = optional(bool)
interval = optional(number)
healthy_threshold = optional(number)
matcher = optional(string)
path = optional(string)
port = optional(number)
timeout = optional(number)
unhealthy_threshold = optional(number)
}))
stickiness = optional(object({
enabled = optional(bool)
type = string
cookie_duration = optional(number)
cookie_name = optional(string)
}))
}))
default = {}
}
variable "enable_cross_zone_load_balancing" {
type = bool
description = "A boolean that determines whether cross zone load balancing is enabled. In application load balancers this feature is always enabled and cannot be disabled. In network and gateway load balancers this feature is disabled by default but can be enabled."
default = false
}
variable "dns_record_client_routing_policy" {
type = string
description = "(optional) Indicates how traffic is distributed among network load balancer Availability Zones only. Possible values are any_availability_zone (client DNS queries are resolved among healthy LB IP addresses across all LB Availability Zones), partial_availability_zone_affinity (85 percent of client DNS queries will favor load balancer IP addresses in their own Availability Zone, while the remaining queries resolve to any healthy zone) and availability_zone_affinity (Client DNS queries will favor load balancer IP address in their own Availability Zone)."
default = "any_availability_zone"
}
variable "access_logs_lifecycle_rule" {
description = "Custom lifecycle rule to override the default one"
type = list(object({
id = string
enabled = string
prefix = string
tags = map(string)
transition = list(object({
days = number
storage_class = string
}))
expiration = object({
days = number
})
noncurrent_version_transition = list(object({
days = number
storage_class = string
}))
noncurrent_version_expiration = object({
days = number
})
}))
default = [
{
id = "main"
enabled = "Enabled"
prefix = ""
tags = {
rule = "log"
autoclean = "true"
}
transition = [
{
days = 90
storage_class = "STANDARD_IA"
},
{
days = 365
storage_class = "GLACIER"
}
]
expiration = {
days = 730
}
noncurrent_version_transition = [
{
days = 90
storage_class = "STANDARD_IA"
},
{
days = 365
storage_class = "GLACIER"
}
]
noncurrent_version_expiration = {
days = 730
}
}
]
}
# set to false for SAP BIP, see https://me.sap.com/notes/0003348935
variable "drop_invalid_header_fields" {
description = "Whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false)."
default = true
}