-
Notifications
You must be signed in to change notification settings - Fork 63
/
variables.tf
282 lines (234 loc) · 8.66 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
# Copyright (c) 2018, 2021 Oracle Corporation and/or affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
# general oci parameters
variable "compartment_ocid" {
description = "(Updatable) The OCID of the compartment where to create all resources"
type = string
}
variable "instance_timeout" {
description = "Timeout setting for creating instance."
type = string
default = "25m"
}
variable "freeform_tags" {
description = "simple key-value pairs to tag the resources created using freeform tags."
type = map(string)
default = null
}
variable "defined_tags" {
description = "predefined and scoped to a namespace to tag the resources created using defined tags."
type = map(string)
default = null
}
locals {
default_freeform_tags = {
# * This list of freeform tags are added by default to user provided freeform tags (var.freeform_tags) if local.merged_freeform_tags is used
terraformed = "Please do not edit manually"
module = "oracle-terraform-modules/compute-instance/oci"
}
merged_freeform_tags = merge(local.default_freeform_tags, var.freeform_tags)
}
# compute instance parameters
variable "ad_number" {
description = "The availability domain number of the instance. If none is provided, it will start with AD-1 and continue in round-robin."
type = number
default = null
}
# variable "fd_number" {
# // for future use, adding fault domain support
# description = "(Updatable) The fault domain of the instance."
# type = number
# default = null
# }
variable "instance_count" {
description = "Number of identical instances to launch from a single module."
type = number
default = 1
}
variable "instance_display_name" {
description = "(Updatable) A user-friendly name for the instance. Does not have to be unique, and it's changeable."
type = string
default = ""
}
variable "instance_flex_memory_in_gbs" {
type = number
description = "(Updatable) The total amount of memory available to the instance, in gigabytes."
default = null
}
variable "instance_flex_ocpus" {
type = number
description = "(Updatable) The total number of OCPUs available to the instance."
default = null
}
variable "instance_state" {
type = string
description = "(Updatable) The target state for the instance. Could be set to RUNNING or STOPPED."
default = "RUNNING"
validation {
condition = contains(["RUNNING", "STOPPED"], var.instance_state)
error_message = "Accepted values are RUNNING or STOPPED."
}
}
variable "shape" {
description = "The shape of an instance."
type = string
default = "VM.Standard2.1"
}
variable "cloud_agent_plugins" {
description = "Whether each Oracle Cloud Agent plugins should be ENABLED or DISABLED."
type = map(string)
default = {
autonomous_linux = "ENABLED"
bastion = "ENABLED"
block_volume_mgmt = "DISABLED"
custom_logs = "ENABLED"
management = "DISABLED"
monitoring = "ENABLED"
osms = "ENABLED"
run_command = "ENABLED"
vulnerability_scanning = "ENABLED"
java_management_service = "DISABLED"
}
#* need to craft a validation condition at some point
}
variable "baseline_ocpu_utilization" {
description = "(Updatable) The baseline OCPU utilization for a subcore burstable VM instance"
type = string
default = "BASELINE_1_1"
validation {
condition = contains(["BASELINE_1_8", "BASELINE_1_2", "BASELINE_1_1"], var.baseline_ocpu_utilization)
error_message = "Accepted values are BASELINE_1_8, BASELINE_1_2 or BASELINE_1_1."
}
}
variable "source_ocid" {
description = "The OCID of an image or a boot volume to use, depending on the value of source_type."
type = string
}
variable "source_type" {
description = "The source type for the instance."
type = string
default = "image"
}
# operating system parameters
variable "extended_metadata" {
description = "(Updatable) Additional metadata key/value pairs that you provide."
type = map(any)
default = {}
}
variable "resource_platform" {
description = "Platform to create resources in."
type = string
default = "linux"
}
variable "ssh_authorized_keys" {
#! Deprecation notice: Please use `ssh_public_keys` instead
description = "DEPRECATED: use ssh_public_keys instead. Public SSH keys path to be included in the ~/.ssh/authorized_keys file for the default user on the instance."
type = string
default = null
}
variable "ssh_public_keys" {
description = "Public SSH keys to be included in the ~/.ssh/authorized_keys file for the default user on the instance. To provide multiple keys, see docs/instance_ssh_keys.adoc."
type = string
default = null
}
variable "user_data" {
description = "Provide your own base64-encoded data to be used by Cloud-Init to run custom scripts or provide custom Cloud-Init configuration."
type = string
default = null
}
# networking parameters
variable "assign_public_ip" {
#! Deprecation notice: will be removed at next major release. Use `var.public_ip` instead.
description = "Deprecated: use `var.public_ip` instead. Whether the VNIC should be assigned a public IP address (Always EPHEMERAL)."
type = bool
default = false
}
variable "hostname_label" {
description = "The hostname for the VNIC's primary private IP."
type = string
default = ""
}
variable "ipxe_script" {
description = "(Optional) The iPXE script which to continue the boot process on the instance."
type = string
default = null
}
variable "private_ips" {
description = "Private IP addresses of your choice to assign to the VNICs."
type = list(string)
default = []
}
variable "public_ip" {
description = "Whether to create a Public IP to attach to primary vnic and which lifetime. Valid values are NONE, RESERVED or EPHEMERAL."
type = string
default = "NONE"
validation {
condition = contains(["NONE", "RESERVED", "EPHEMERAL"], var.public_ip)
error_message = "Accepted values are NONE, RESERVED or EPHEMERAL."
}
}
variable "public_ip_display_name" {
description = "(Updatable) A user-friendly name. Does not have to be unique, and it's changeable."
type = string
default = null
}
variable "skip_source_dest_check" {
description = "Whether the source/destination check is disabled on the VNIC."
type = bool
default = false
}
variable "subnet_ocids" {
description = "The unique identifiers (OCIDs) of the subnets in which the instance primary VNICs are created."
type = list(string)
}
variable "vnic_name" {
description = "A user-friendly name for the VNIC."
type = string
default = ""
}
variable "primary_vnic_nsg_ids" {
description = "A list of the OCIDs of the network security groups (NSGs) to add the primary VNIC to"
type = list(string)
default = null
}
# storage parameters
variable "attachment_type" {
description = "(Optional) The type of volume. The only supported values are iscsi and paravirtualized."
type = string
default = "paravirtualized"
}
variable "block_storage_sizes_in_gbs" {
description = "Sizes of volumes to create and attach to each instance."
type = list(number)
default = []
}
# variable "block_storage_enable_autotune" {
# // for future use, adding block volume performance auto-tune
# description = "(Optional) (Updatable) Specifies whether the auto-tune performance is enabled for this volume."
# type = bool
# default = true
# }
variable "boot_volume_backup_policy" {
description = "Choose between default backup policies : gold, silver, bronze. Use disabled to affect no backup policy on the Boot Volume."
type = string
default = "disabled"
validation {
condition = contains(["gold", "silver", "bronze", "disabled"], var.boot_volume_backup_policy)
error_message = "Accepted values are gold, silver, bronze or disabled (case sensitive)."
}
}
variable "boot_volume_size_in_gbs" {
description = "The size of the boot volume in GBs."
type = number
default = null
}
variable "preserve_boot_volume" {
description = "Specifies whether to delete or preserve the boot volume when terminating an instance."
type = bool
default = false
}
variable "use_chap" {
description = "(Applicable when attachment_type=iscsi) Whether to use CHAP authentication for the volume attachment."
type = bool
default = false
}