-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathvariables.tf
More file actions
362 lines (297 loc) · 10.9 KB
/
Copy pathvariables.tf
File metadata and controls
362 lines (297 loc) · 10.9 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
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
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# Copyright 2023-2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
variable "host_project_id" {
type = string
description = "Project Id of the Host GCP Project."
}
variable "service_project_id" {
type = string
default = null
description = "Project Id of the Service GCP Project attached to the Host GCP project."
}
variable "cloudsql_instance_name" {
type = string
description = "Name of the cloud sql instance which will be created."
}
variable "region" {
type = string
description = "Name of a GCP region."
}
variable "zone" {
type = string
description = "Name of a GCP zone, should be in the same region as specified in the region variable."
}
variable "database_version" {
type = string
description = "Database version of the mysql in Cloud SQL ."
}
variable "subnetwork_ip_cidr" {
type = string
description = "CIDR range for the subnet to be created if var.create_subnetwork is set to true."
}
variable "gce_tags" {
type = list(string)
default = ["cloudsql"]
description = "List of tags to be applied to gce instance."
}
variable "terraform_sa_name" {
type = string
default = "terraform-sa"
description = "Name of the service account to be used by the terraform for automation & execution in build jobs."
}
variable "gce_sa_name" {
type = string
default = "gce-sa"
description = "Name of the service account to be used by the compute instance."
}
variable "startup_script" {
description = "User startup script to run when instances spin up"
type = string
default = null
}
variable "network_tier" {
type = string
default = "STANDARD"
description = "Networking tier to be used."
}
variable "network_routing_mode" {
type = string
default = "GLOBAL"
description = "Network Routing Mode to be used, Could be REGIONAL or GLOBAL."
}
variable "network_name" {
type = string
description = "Name of the VPC network to be created if var.create_network is marked as true or Name of the already existing network if var.create_network is false."
}
variable "subnetwork_name" {
type = string
description = "Name of the sub network to be created if var.create_subnetwork is marked as true or Name of the already existing sub network if var.create_subnetwork is false."
}
variable "create_network" {
type = bool
default = true
description = "Variable to determine if a new network should be created or not."
}
variable "create_subnetwork" {
type = bool
default = true
description = "Variable to determine if a new sub network should be created or not."
}
variable "flow_sampling" {
type = number
default = 0.5
description = "Flow sampling rate of logs."
}
variable "aggregation_interval" {
type = string
default = "INTERVAL_10_MIN"
description = "The aggregation interval for flow logs in that subnet. The interval can be set to any of the following: 5-sec (default), 30-sec, 1-min, 5-min, 10-min, or 15-min."
}
variable "metadata" {
type = string
default = "INCLUDE_ALL_METADATA"
description = "The metadata annotations that you want to include in the logs."
}
variable "enable_private_access" {
type = bool
default = true
description = "Enable private access in the subnet."
}
variable "enable_export_routes" {
type = bool
default = true
description = "Enable export routes."
}
variable "enable_import_routes" {
type = bool
default = true
description = "Enable import routes."
}
variable "test_dbname" {
type = string
default = "test_db"
description = "Database Name to be created from startup script."
}
#######
# nat
######
variable "router_name" {
description = "Name of the router to be used by the NAT."
default = "sqleasynatrouter"
}
variable "nat_name" {
description = "Name of the cloud nat to be created."
default = "sqleasy-nat"
}
variable "create_nat" {
description = "Boolean variable to create the Cloud NAT for allowing the VM to connect to external Internet."
type = bool
default = true
}
#######
# disk
#######
variable "source_image" {
description = "Source disk image. If neither source_image nor source_image_family is specified, defaults to the latest public image."
type = string
default = ""
}
variable "source_image_family" {
description = "Source image family. If neither source_image nor source_image_family is specified, defaults to the latest public image."
type = string
default = "ubuntu-2204-lts"
}
variable "source_image_project" {
description = "Project where the source image comes from. The default project contains images."
type = string
default = "ubuntu-os-cloud"
}
variable "deletion_protection" {
description = "Enable delete protection."
type = bool
default = true
}
variable "cloudsql_private_range_name" {
description = "Name of the default IP range."
default = "privateip-range"
}
variable "cloudsql_private_range_cidr" {
description = "Cidr of the private IP range."
default = ""
}
variable "cloudsql_private_range_prefix_length" {
description = "Prefix length of the private IP range."
default = "20"
}
###########################
# Public IP
###########################
variable "access_config" {
description = "Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet."
type = object({
nat_ip = string
network_tier = string
})
default = null
}
###########################
# Interconnect IP
###########################
variable "interconnect_project_id" {
description = "The ID of the project in which the resource(physical connection at colocation facilitity) belongs."
type = string
}
variable "first_interconnect_name" {
description = "Name of the first interconnect object. This will be used to populate the URL of the underlying Interconnect object that this attachment's traffic will traverse through."
type = string
}
variable "second_interconnect_name" {
description = "Name of the second interconnect object. This will be used to populate the URL of the underlying Interconnect object that this attachment's traffic will traverse through."
type = string
}
variable "ic_router_name" {
description = "Name of the interconnect router."
type = string
default = "interconnect-router"
}
variable "ic_router_bgp_asn" {
description = "Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource."
type = string
}
variable "ic_router_advertise_mode" {
description = "User-specified flag to indicate which mode to use for advertisement. Default value is DEFAULT. Possible values are: DEFAULT, CUSTOM"
type = string
default = "CUSTOM"
}
variable "ic_router_advertise_groups" {
description = "User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertiseMode is CUSTOM and is advertised to all peers of the router."
type = list(string)
default = ["ALL_SUBNETS"]
}
variable "user_specified_ip_range" {
description = "User-specified list of individual IP ranges to advertise in custom mode. This range specifies google private api address."
type = list(string)
default = ["199.36.154.8/30"]
}
variable "create_mysql_db" {
type = bool
default = true
description = "Flag to check if an mysql db needs to be created"
}
## First Vlan Attachment
variable "first_va_name" {
description = "The name of the first interconnect attachment"
type = string
default = "vlan-attachment-a"
}
variable "first_va_description" {
description = "The description of the first interconnect attachment"
type = string
default = "interconnect-a vlan attachment 0"
}
variable "first_va_asn" {
description = "(Required) Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource."
type = string
}
variable "first_va_bandwidth" {
description = "Provisioned bandwidth capacity for the first interconnect attachment."
type = string
default = "BPS_10G"
}
variable "first_va_bgp_range" {
description = "Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc)."
type = string
}
variable "first_vlan_tag" {
description = "The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094."
type = number
}
variable "create_first_vc_router" {
description = "Select 'true' to create a separate router for this VLAN attachment, or 'false' to use the current router configuration."
type = bool
default = false
}
## Second Vlan Attachment
variable "second_va_name" {
description = "The name of the Second interconnect attachment."
type = string
default = "vlan-attachment-b"
}
variable "second_va_description" {
description = "The description of the second interconnect attachment"
type = string
default = "interconnect-b vlan attachment 1"
}
variable "second_va_asn" {
description = "(Required) Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource."
type = string
}
variable "second_va_bandwidth" {
description = "Provisioned bandwidth capacity for the second interconnect attachment."
type = string
default = "BPS_10G"
}
variable "second_va_bgp_range" {
description = "Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc)."
type = string
}
variable "second_vlan_tag" {
description = "The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094."
type = number
}
variable "create_second_vc_router" {
description = "Select 'true' to create a separate router for this VLAN attachment, or 'false' to use the current router configuration."
type = bool
default = false
}