-
Notifications
You must be signed in to change notification settings - Fork 90
/
variables.tf
289 lines (229 loc) · 6.79 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
/**
* Copyright 2021 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 "image" {
type = string
description = "Source image for the Bastion. If image is not specified, image_family will be used (which is the default)."
default = ""
}
variable "image_family" {
type = string
description = "Source image family for the Bastion."
default = "debian-12"
}
variable "image_project" {
type = string
description = "Project where the source image for the Bastion comes from"
default = "debian-cloud"
}
variable "create_instance_from_template" {
type = bool
description = "Whether to create and instance from the template or not. If false, no instance is created, but the instance template is created and usable by a MIG"
default = true
}
variable "tags" {
type = list(string)
description = "Network tags, provided as a list"
default = []
}
variable "labels" {
type = map(any)
description = "Key-value map of labels to assign to the bastion host"
default = {}
}
variable "machine_type" {
type = string
description = "Instance type for the Bastion host"
default = "n1-standard-1"
}
variable "members" {
type = list(string)
description = "List of IAM resources to allow access to the bastion host"
default = []
}
variable "name" {
type = string
description = "Name of the Bastion instance"
default = "bastion-vm"
}
variable "name_prefix" {
type = string
description = "Name prefix for instance template"
default = "bastion-instance-template"
}
variable "network" {
type = string
description = "Self link for the network on which the Bastion should live"
}
variable "network_ip" {
type = string
description = "Private IP address for the bastion host"
default = ""
}
variable "project" {
type = string
description = "The project ID to deploy to"
}
variable "host_project" {
type = string
description = "The network host project ID"
default = ""
}
variable "scopes" {
type = list(string)
description = "List of scopes to attach to the bastion host"
default = ["cloud-platform"]
}
variable "service_account_roles" {
type = list(string)
description = "List of IAM roles to assign to the service account."
default = [
"roles/logging.logWriter",
"roles/monitoring.metricWriter",
"roles/monitoring.viewer",
"roles/compute.osLogin",
]
}
variable "service_account_roles_supplemental" {
type = list(string)
description = "An additional list of roles to assign to the bastion if desired"
default = []
}
variable "service_account_name" {
type = string
description = "Account ID for the service account"
default = "bastion"
}
variable "service_account_email" {
type = string
description = "If set, the service account and its permissions will not be created. The service account being passed in should have at least the roles listed in the `service_account_roles` variable so that logging and OS Login work as expected."
default = ""
}
variable "shielded_vm" {
type = bool
description = "Enable shielded VM on the bastion host (recommended)"
default = true
}
variable "startup_script" {
type = string
description = "Render a startup script with a template."
default = ""
}
variable "subnet" {
type = string
description = "Self link for the subnet on which the Bastion should live. Can be private when using IAP"
}
variable "zone" {
type = string
description = "The primary zone where the bastion host will live"
default = "us-central1-a"
}
variable "region" {
type = string
description = "The region where the bastion instance template will live"
default = null
}
variable "random_role_id" {
type = bool
description = "Enables role random id generation."
default = true
}
variable "fw_name_allow_ssh_from_iap" {
type = string
description = "Firewall rule name for allowing SSH from IAP"
default = "allow-ssh-from-iap-to-tunnel"
}
variable "additional_ports" {
description = "A list of additional ports/ranges to open access to on the instances from IAP."
type = list(string)
default = []
}
variable "disk_size_gb" {
description = "Boot disk size in GB"
type = number
default = 100
}
variable "disk_type" {
description = "Boot disk type, can be either pd-ssd, local-ssd, or pd-standard"
type = string
default = "pd-standard"
}
variable "disk_labels" {
type = map(any)
description = "Key-value map of labels to assign to the bastion host disk"
default = {}
}
variable "metadata" {
type = map(string)
description = "Key-value map of additional metadata to assign to the instances"
default = {}
}
variable "external_ip" {
type = bool
description = "Set to true if an ephemeral or static external IP/DNS is required, must also set access_config if true"
default = false
}
variable "preemptible" {
type = bool
description = "Allow the instance to be preempted"
default = false
}
variable "access_config" {
description = "Access configs for network, nat_ip and DNS"
type = list(object({
network_tier = string
nat_ip = string
public_ptr_domain_name = string
}))
default = [{
nat_ip = "",
network_tier = "PREMIUM",
public_ptr_domain_name = ""
}]
}
variable "create_firewall_rule" {
type = bool
description = "If we need to create the firewall rule or not."
default = true
}
variable "additional_networks" {
description = "Additional network interface details for the instance template, if any."
default = []
type = list(object({
network = string
subnetwork = string
subnetwork_project = string
network_ip = string
nic_type = string
stack_type = string
queue_count = number
access_config = list(object({
nat_ip = string
network_tier = string
}))
ipv6_access_config = list(object({
network_tier = string
}))
alias_ip_range = list(object({
ip_cidr_range = string
subnetwork_range_name = string
}))
}))
}
variable "can_ip_forward" {
type = bool
description = "Whether the bastion should allow IP forwarding."
default = false
}