forked from oracle-quickstart/oci-arch-vip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
269 lines (228 loc) · 9.42 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
# Copyright (c) 2020, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
#############################
# tenancy details
#############################
# Get this from the bottom of the OCI screen (after logging in, after Tenancy ID: heading)
variable "tenancy_id" {
description = "Get this from the bottom of the OCI screen (after logging in, after Tenancy ID: heading)"
}
# Get this from OCI > Identity > Users (for your user account)
variable "user_id" {
description = "Get this from OCI > Identity > Users (for your user account)"
}
# the fingerprint can be gathered from your user account (OCI > Identity > Users > click your username > API Keys fingerprint (select it, copy it and paste it below))
variable "fingerprint" {
description = "The fingerprint can be gathered from your user account (OCI > Identity > Users > click your username > API Keys fingerprint (select it, copy it and paste it below))"
}
# this is the full path on your local system to the private key used for the API key pair
variable "private_key_path" {
description = "This is the full path on your local system to the private key used for the API key pair"
}
# region (us-phoenix-1, ca-toronto-1, etc)
variable "region" {
default = "eu-frankfurt-1"
description = "region (us-phoenix-1, ca-toronto-1, etc)"
}
# default compartment
variable "default_compartment_id" {
description = "default compartment OCID"
}
# Compartment where the IAM artifacts will be created - if null then default_compartment_id will be used
variable "iam_compartment_id" {
description = "Compartment where the IAM artifacts will be created - if null then default_compartment_id will be used"
}
#############################
# naming convension
#############################
# the prefix that will be used for all the names of the OCI artifacts that this automation will provision
variable "names_prefix" {
type = string
default = "oci-vip-nginx"
description = "the prefix that will be used for all the names of the OCI artifacts that this automation will provision"
}
# the defined tags to be used for all the artifacts that this automation will provision
variable "defined_tags" {
type = map(string)
description = "the defined tags to be used for all the artifacts that this automation will provision"
}
# the freeform tags to be used for all the artifacts that this automation will provision
variable "freeform_tags" {
type = map(string)
default = { "Solution" = "Oracle Cloud Infrastructure SDF Solutions - Virtual Floating IP(VIP)" }
description = "the freeform tags to be used for all the artifacts that this automation will provision"
}
#############################
# volumes - block storage
#############################
# The specific block volumes compartment id. If this is null then the default, project level compartment_id will be used.
variable "block_storage_compartment_id" {
description = "The specific block volumes compartment id. If this is null then the default, project level compartment_id will be used."
}
# The aditional block volumes mount point
variable "aditional_block_volume_mount_point" {
type = string
default = "/u01"
description = "The aditional block volumes mount point"
}
# The aditional block volumes size
variable "aditional_block_volume_size" {
type = number
default = 50
description = "The aditional block volumes size"
}
# The aditional block volumes backup policy: Bronze, Silver or Gold. Default = Bronze. Null = Bronze
variable "volumes_backup_policy" {
type = string
default = "Bronze"
description = "The aditional block volumes backup policy: Bronze, Silver or Gold. Default = Bronze. Null = Bronze"
}
#############################
# OCI VIP network
#############################
# The specific network compartment id. If this is null then the default, project level compartment_id will be used.
variable "network_compartment_id" {
description = "The specific network compartment id. If this is null then the default, project level compartment_id will be used."
}
# the VCN id where the VIP network components will be provisioned
variable "vcn_id" {
description = "The VCN id where the VIP network components will be provisioned"
}
# VIP subnet CIDR
variable "oci_vip_subnet_cidr" {
type = string
default = "10.0.80.0/24"
description = "VIP subnet CIDR"
}
# VIP subnet DHCP options
variable "dhcp_options" {
type = object({
oci_vip_dhcp_option = object({
server_type = string,
search_domain_name = string,
forwarder_1_ip = string,
forwarder_2_ip = string,
forwarder_3_ip = string
})
})
default = {
oci_vip_dhcp_option = {
server_type = "VcnLocalPlusInternet"
search_domain_name = "DomainNameServer"
forwarder_1_ip = null
forwarder_2_ip = null
forwarder_3_ip = null
}
}
description = "VIP subnet DHCP options"
}
# The route table attached to the VIP subnet. Configuration supports both public internet routes and private routes
variable "oci_vip_route_table" {
type = object({
route_rules = list(object({
# route to public internet ("0.0.0.0/0") or to private destination
dst = string,
dst_type = string,
# next hop can be an Internet Gateway or other Gateway(ex. DRG)
next_hop_id = string
}))
})
default = {
route_rules = [{
dst = "0.0.0.0/0",
dst_type = "CIDR_BLOCK",
next_hop_id = "ocid1.internetgateway.XXXXXXX"
}]
}
description = "The route table attached to the VIP subnet. Configuration supports both public internet routes and private routes"
}
# option for having a public and private VIP or just a private VIP
variable "assign_public_ip" {
type = bool
default = true
description = "Option for having a public and private VIP or just a private VIP"
}
#############################
# File System Details
#############################
# The specific FSS compartment id. If this is null then the default, project level compartment_id will be used.
variable "fss_compartment_id" {
description = "The specific FSS compartment id. If this is null then the default, project level compartment_id will be used."
}
# The FSS configuration. If null(file_system = null) then no FSS artifacts will not be configured
variable "file_system" {
type = object({
# the File Sytem and mount target AD - AD number
availability_domain = number
export_path = string
})
default = {
availability_domain = 1
export_path = "/u02"
}
description = "The FSS configuration. If null(file_system = null) then no FSS artifacts will not be configured"
}
# the folder(mount point) where the FSS NFS share will be mounted
variable "fss_mount_point" {
type = string
default = "/u02"
description = "The folder(mount point) where the FSS NFS share will be mounted"
}
#############################
# OCI VIP Instances
#############################
# The specific compute compartment id. If this is null then the default, project level compartment_id will be used.
variable "compute_compartment_id" {
description = "The specific compute compartment id. If this is null then the default, project level compartment_id will be used."
}
# The number of cluster nodes to be provisioned
variable "cluster_size" {
type = number
default = 6
description = "The number of cluster nodes to be provisioned"
}
# Compute instances ssh public key
variable "ssh_private_key_path" {
description = "Compute instances ssh public key"
}
# Compute instances ssh private key
variable "ssh_public_key_path" {
description = "Compute instances ssh private key"
}
# The name of the shape to be used for all the provisioned compute instances. The automation will automatically figure out the OCID for the spaecific shape name in the target region.
variable "shape" {
type = string
default = "VM.Standard2.1"
description = "The name of the shape to be used for all the provisioned compute instances. The automation will automatically figure out the OCID for the spaecific shape name in the target region."
}
# The name of the image to be used for all the provisioned compute instances. The automation will automatically figure out the OCID for the specific image name in the target region.
variable "image_name" {
type = string
default = "Oracle-Linux-7.7-2019.10.19-0"
description = "The name of the image to be used for all the provisioned compute instances. The automation will automatically figure out the OCID for the specific image name in the target region."
}
# VIP instances configuration
# Accepted values: ["Apache", "Nginx"]
variable "keepalived_check" {
type = string
default = "Nginx"
description = "Accepted values: [Apache, Nginx]"
}
# Keepalived check script
# Only 2 values are accepted:
# - "'/usr/sbin/pidof httpd'"
# - "'/usr/sbin/pidof nginx'"
variable "install_product" {
type = string
default = "'/usr/sbin/pidof nginx'"
description = "Keepalived check script. Only 2 values are accepted: ['/usr/sbin/pidof httpd', '/usr/sbin/pidof nginx']"
}
#############################
# OCI VIP Util Nodes
#############################
# Option to have an util compute node provisioned or not.
variable "provision_util_node" {
type = bool
default = true
description = "Option to have an util compute node provisioned or not."
}