-
Notifications
You must be signed in to change notification settings - Fork 1
/
variables.tf
275 lines (238 loc) · 5.8 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
#
# yandex cloud coordinates
#
variable "folder_id" {
description = "Folder ID"
type = string
default = null
}
#
# naming
#
variable "name" {
description = "Name which will be used for all resources"
type = string
}
variable "description" {
description = "Instance description"
type = string
default = null
}
variable "labels" {
description = "A set of labels which will be applied to all resources"
type = map(string)
default = {}
}
#
# network
#
variable "zone" {
description = "Network zone"
type = string
default = null
}
variable "subnet_id" {
description = "VPC Subnet ID"
type = string
}
variable "enable_nat" {
description = "Enable public IPv4 address"
type = bool
default = null
}
variable "create_pip" {
description = "Create public IP address for instance; If true public_ip_address will be ignored"
type = bool
default = true
}
variable "public_ip_address" {
description = "Public IP address to assign to the instance"
type = string
default = null
}
variable "enable_ipv4" {
description = "Allocate an IPv4 address for the interface"
type = string
default = true
}
variable "private_ip_address" {
description = "Private IP address to assign to the instance. If empty, the address will be automatically assigned from the specified subnet"
type = string
default = null
}
variable "enable_ipv6" {
description = "Allocate an IPv6 address for the interface"
type = string
default = false
}
variable "private_ipv6_address" {
description = "Private IPv6 address to assign to the instance. If empty, the address will be automatically assigned from the specified subnet"
type = string
default = null
}
variable "security_group_ids" {
description = "Security group IDs linked to the instance"
type = list(string)
default = null
}
variable "network_acceleration_type" {
description = "Network acceleration type"
type = string
default = "standard"
}
variable "serial_port_enable" {
description = "Enable serial port on the instance"
type = bool
default = false
}
variable "docker_compose" {
description = "The key in the VM metadata that uses the docker-compose specification"
type = string
default = null
}
#
# vm size
#
variable "platform_id" {
description = "Hardware CPU platform name (Intel Ice Lake by default)"
type = string
default = "standard-v3"
}
variable "cores" {
description = "Cores allocated to the instance"
type = number
default = 2
}
variable "memory" {
description = "Memory allocated to the instance (in Gb)"
type = number
default = 2
}
variable "core_fraction" {
description = "Core fraction applied to the instance"
type = number
default = null
}
#
# scheduling
#
variable "preemptible" {
description = "Make instance preemptible"
type = bool
default = false
}
variable "placement_group_id" {
description = "Placement group ID"
type = string
default = ""
}
variable "placement_affinity_rules" {
description = "List of host affinity rules"
type = list(object({
key = string
op = string
value = list(string)
}))
default = []
}
#
# vm image
#
variable "image_snapshot_id" {
description = <<-EOT
Image snapshot id to initialize from.
Highest priority over var.image_id
and var.image_family"
EOT
type = string
default = null
}
variable "image_id" {
description = "Image ID (medium priority)"
type = string
default = null
}
variable "image_family" {
description = "Default image family name (lowest priority)"
type = string
default = "ubuntu-2004-lts"
}
#
# vm options
#
variable "hostname" {
description = "Hostname of the instance. More info: https://cloud.yandex.ru/docs/compute/concepts/network#hostname"
type = string
default = null
}
variable "service_account_id" {
description = "ID of the service account authorized for instance"
type = string
default = null
}
variable "allow_stopping_for_update" {
description = "Allow stop the instance in order to update properties"
type = bool
default = true
}
variable "generate_ssh_key" {
description = "If true, SSH key will be generated for instance group"
type = string
default = true
}
variable "ssh_user" {
description = "Initial SSH username for instance"
type = string
default = "ubuntu"
}
variable "ssh_pubkey" {
description = "Public RSA key path to inject"
type = string
default = null
}
variable "enable_oslogin" {
description = "Enable OS Login"
type = string
default = false
}
variable "user_data" {
description = "Cloud-init user-data"
type = string
default = null
}
#
# vm disks
#
variable "boot_disk" {
description = "Basic boot disk parameters"
type = object({
auto_delete = optional(bool)
device_name = optional(string)
mode = optional(string)
disk_id = optional(string, null)
})
default = {}
}
variable "boot_disk_initialize_params" {
description = "Additional boot disk parameters"
type = object({
size = optional(number, 10)
block_size = optional(number, 4096)
type = optional(string, "network-hdd")
})
default = {}
}
variable "secondary_disks" {
description = "Additional disks with params"
type = map(object({
enabled = optional(bool, true)
auto_delete = optional(bool, false)
mode = optional(string)
labels = optional(map(string), {})
type = optional(string, "network-hdd")
size = optional(number, 10)
block_size = optional(number, 4096)
device_name = optional(string)
}))
default = {}
}