-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
208 lines (175 loc) · 6.27 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
##############################################################################
# Module Variables
##############################################################################
variable "prefix" {
description = "The prefix that you would like to prepend to your resources"
type = string
}
variable "tags" {
description = "List of Tags for the resource created"
type = list(string)
default = null
}
variable "resource_group_id" {
description = "Resource group ID for the VSI"
type = string
default = null
}
##############################################################################
##############################################################################
# VPC Variables
##############################################################################
variable "vpc_id" {
description = "ID of the VPC where VSI will be provisioned"
type = string
}
variable "subnet_zone_list" {
description = "List of subnets where the VSI deployment primary network interfaces will be created. This is intended to be an output from the ICSE Subnet Module or templates using it."
type = list(
object({
name = string
id = string
zone = string
cidr = string
})
)
}
variable "secondary_subnet_zone_list" {
description = "(Optional) List of secondary subnets to use for VSI. For each secondary subnet in this list, a network interface will be attached to each VSI in the same zone."
type = list(
object({
name = string
id = string
zone = string
cidr = string
# optional interface reference shortname used for secondary security group creation
shortname = optional(string)
security_group_ids = optional(list(string))
allow_ip_spoofing = optional(bool)
})
)
default = []
}
variable "vsi_per_subnet" {
description = "Number of identical VSI to provision on each subnet"
type = number
default = 1
}
##############################################################################
##############################################################################
# Subnet Variables
##############################################################################
variable "primary_allowed_vlans" {
description = "Comma separated VLANs, Indicates what VLAN IDs (for VLAN type only) can use this physical (PCI type) interface. A given VLAN can only be in the allowed_vlans array for one PCI type adapter per bare metal server."
type = list(string)
default = null
}
variable "primary_enable_infrastructure_nat" {
description = " If true, the VPC infrastructure performs any needed NAT operations. If false, the packet is passed unmodified to/from the network interface, allowing the workload to perform any needed NAT operations. [default : true]"
type = bool
default = true
}
##############################################################################
##############################################################################
# VSI Variables
##############################################################################
variable "deployment_name" {
description = "Name of the VSI deployment. This will be used to dynamically configure server names."
type = string
default = "icse"
}
variable "image_id" {
description = "ID of the server image to use for VSI creation"
type = string
default = "r010-68ec6c5d-c687-4dd3-8259-6f10d24ecd44"
}
variable "profile" {
description = "Type of machine profile for VSI. Use the command `ibmcloud is baremetal-profiles` to find available profiles in your region"
type = string
default = "cx2-metal-96x192"
}
variable "ssh_key_ids" {
description = "List of SSH Key Ids. At least one SSH key must be provided"
type = list(string)
validation {
error_message = "To provision VSI at least one VPC SSH Ket must be provided."
condition = length(var.ssh_key_ids) > 0
}
}
variable "boot_volume_name" {
description = "Boot volume name"
type = string
default = "eth0"
}
##############################################################################
##############################################################################
# Security Group Variables
##############################################################################
variable "primary_security_group_ids" {
description = "(Optional) List of security group ids to add to the primary network interface of each virtual server. Using an empty list will assign the default VPC security group."
type = list(string)
default = null
validation {
error_message = "Primary security group IDs should be either `null` or contain at least one security group."
condition = (
var.primary_security_group_ids == null
? true
: length(var.primary_security_group_ids) > 0
)
}
}
variable "primary_interface_security_group" {
description = "Object describing a security group to create for the primary interface,"
type = object({
create = bool
rules = list(
object({
name = string
direction = string
remote = string
tcp = optional(
object({
port_max = number
port_min = number
})
)
udp = optional(
object({
port_max = number
port_min = number
})
)
icmp = optional(
object({
type = number
code = number
})
)
})
)
})
default = {
create = false
rules = []
}
}
##############################################################################
##############################################################################
# Common Optional Variables
##############################################################################
variable "user_data" {
description = "(Optional) Data to transfer to instance"
type = string
default = null
}
variable "allow_ip_spoofing" {
description = "Allow IP spoofing on primary network interface"
type = bool
default = false
}
variable "add_floating_ip" {
description = "Add a floating IP to the primary network interface."
type = bool
default = false
}
##############################################################################