-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathvariables.tf
More file actions
296 lines (250 loc) · 12.3 KB
/
variables.tf
File metadata and controls
296 lines (250 loc) · 12.3 KB
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
290
291
292
293
294
295
296
variable "powervs_zone" {
description = "IBM Cloud data center location where IBM PowerVS infrastructure will be created."
type = string
}
variable "prefix" {
description = "A unique identifier for resources. Must begin with a lowercase letter and end with a lowercase letter or number. Must contain only lowercase letters, numbers, and - characters. This prefix will be prepended to any resources provisioned by this template. Prefixes must be 16 or fewer characters."
type = string
}
variable "tshirt_size" {
description = "PowerVS instance profiles. These profiles can be overridden by specifying 'custom_profile_instance_boot_image' and 'custom_profile' values in optional parameters."
type = object({
tshirt_size = string
image = string
})
validation {
condition = contains(["custom", "aix_xs", "aix_s", "aix_m", "aix_l", "ibm_i_xs", "ibm_i_s", "ibm_i_m", "ibm_i_l", "sap_dev_rhel", "sap_dev_sles"], var.tshirt_size.tshirt_size)
error_message = "Only Following values are supported : custom, aix_xs, aix_s, aix_m, aix_l, ibm_i_xs, ibm_i_s, ibm_i_m, ibm_i_l, sap_dev_rhel, sap_dev_sles"
}
}
variable "ssh_public_key" {
description = "Public SSH Key for VSI creation. Must be an RSA key with a key size of either 2048 bits or 4096 bits (recommended). Must be a valid SSH key that does not already exist in the deployment region. If you're unsure how to create one, check [Generate a SSH Key Pair](https://cloud.ibm.com/docs/powervs-vpc?topic=powervs-vpc-powervs-automation-prereqs#powervs-automation-ssh-key) in our docs. For more information about SSH keys, see [SSH keys](https://cloud.ibm.com/docs/vpc?topic=vpc-ssh-keys) in the VPC docs."
type = string
}
variable "ssh_private_key" {
description = "Private SSH key (RSA format) to login to Intel VSIs to configure network management services (SQUID, NTP, DNS and ansible). Should match to public SSH key referenced by 'ssh_public_key'. The key is not uploaded or stored. If you're unsure how to create one, check [Generate a SSH Key Pair](https://cloud.ibm.com/docs/powervs-vpc?topic=powervs-vpc-powervs-automation-prereqs#powervs-automation-ssh-key) in our docs. For more information about SSH keys, see [SSH keys](https://cloud.ibm.com/docs/vpc?topic=vpc-ssh-keys) in the VPC docs."
type = string
sensitive = true
}
variable "ibmcloud_api_key" {
description = "The IBM Cloud platform API key needed to deploy IAM enabled resources."
type = string
sensitive = true
}
variable "ansible_vault_password" {
description = "Vault password to encrypt ansible playbooks that contain sensitive information. Password requirements: 15-100 characters and at least one uppercase letter, one lowercase letter, one number, and one special character. Allowed characters: A-Z, a-z, 0-9, !#$%&()*+-.:;<=>?@[]_{|}~."
type = string
sensitive = true
}
#####################################################
# Optional Parameters VPC
#####################################################
variable "vpc_subnet_cidrs" {
description = "CIDR values for the VPC subnets to be created. It's customer responsibility that none of the defined networks collide, including the PowerVS subnets and VPN client pool."
type = object({
vpn = string
mgmt = string
vpe = string
edge = string
})
default = {
"vpn" = "10.30.10.0/24"
"mgmt" = "10.30.20.0/24"
"vpe" = "10.30.30.0/24"
"edge" = "10.30.40.0/24"
}
}
#####################################################
# Optional Parameters PowerVS Instance
#####################################################
variable "custom_profile_instance_boot_image" {
description = "Override the t-shirt size specs of PowerVS Workspace instance by selecting an image name and providing valid 'custom_profile' optional parameter."
type = string
default = "none"
}
variable "custom_profile" {
description = "Overrides t-shirt profile: Custom PowerVS instance. Specify 'sap_profile_id' [here](https://cloud.ibm.com/docs/sap?topic=sap-hana-iaas-offerings-profiles-power-vs) or combination of 'cores' & 'memory'. Optionally volumes can be created."
type = object({
sap_profile_id = string
cores = string
memory = string
server_type = string
proc_type = string
storage = object({
size = string
tier = string
})
})
default = {
"sap_profile_id" : null,
"cores" : "",
"memory" : "",
"server_type" : "",
"proc_type" : "",
"storage" : {
"size" : "",
"tier" : ""
}
}
validation {
condition = (((var.custom_profile.sap_profile_id == null || var.custom_profile.sap_profile_id == "") && ((var.custom_profile.cores == "" && var.custom_profile.memory == "" && var.custom_profile.proc_type == "" && var.custom_profile.server_type == "") || (var.custom_profile.cores != "" && var.custom_profile.memory != "" && var.custom_profile.server_type != "" && var.custom_profile.proc_type != ""))) || (var.custom_profile.sap_profile_id != null && (var.custom_profile.cores == "" && var.custom_profile.memory == "" && var.custom_profile.proc_type == "" && var.custom_profile.server_type == "")))
error_message = "Invalid custom config. If 'sap_profile_id' is not null or empty, then cores, memory, server_type and proc_type must be empty."
}
}
#####################################################
# Optional Parameters PowerVS Workspace
#####################################################
variable "powervs_management_network" {
description = "Name of the IBM Cloud PowerVS management subnet and CIDR to create."
type = object({
name = string
cidr = string
})
default = {
"name" : "mgmt_net",
"cidr" : "10.51.0.0/24"
}
validation {
condition = can(regex("^([a-z]|[a-z][-_a-z0-9]*[a-z0-9])$", var.powervs_management_network.name))
error_message = "powervs_management_network.name can only contain 'a-z', '0-9', '-', '_' and must end on a letter or number."
}
}
variable "powervs_backup_network" {
description = "Name of the IBM Cloud PowerVS backup network and CIDR to create."
type = object({
name = string
cidr = string
})
default = {
"name" : "bkp_net",
"cidr" : "10.52.0.0/24"
}
validation {
condition = var.powervs_backup_network != null ? can(regex("^([a-z]|[a-z][-_a-z0-9]*[a-z0-9])$", var.powervs_backup_network.name)) : true
error_message = "powervs_backup_network.name can only contain 'a-z', '0-9', '-', '_' and must end on a letter or number."
}
}
variable "powervs_resource_group_name" {
description = "Existing IBM Cloud resource group name."
type = string
default = "Default"
}
variable "tags" {
description = "List of tag names for the IBM Cloud PowerVS workspace"
type = list(string)
default = []
}
#####################################################
# Optional Parameters for intel VSI
#####################################################
variable "vpc_intel_images" {
description = "Stock OS image names for creating VPC landing zone VSI instances: RHEL (management and network services) and SLES (monitoring)."
type = object({
rhel_image = string
sles_image = string
})
default = {
"rhel_image" : "ibm-redhat-9-6-amd64-sap-applications-4"
"sles_image" : "ibm-sles-15-7-amd64-sap-applications-3"
}
}
variable "network_services_vsi_profile" {
description = "Compute profile configuration of the network services vsi (cpu and memory configuration). Must be one of the supported profiles. See [here](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui)."
type = string
default = "cxf-2x4"
}
variable "external_access_ip" {
description = "Specify the source IP address or CIDR for login through SSH to the environment after deployment. Access to the environment will be allowed only from this IP address. Can be set to 'null' if you choose to use client to site vpn."
type = string
default = "0.0.0.0/0"
}
variable "configure_dns_forwarder" {
description = "Specify if DNS forwarder will be configured. This will allow you to use central DNS servers (e.g. IBM Cloud DNS servers) sitting outside of the created IBM PowerVS infrastructure. If yes, ensure 'dns_forwarder_config' optional variable is set properly. DNS forwarder will be installed on the network-services vsi."
type = bool
default = true
}
variable "configure_ntp_forwarder" {
description = "Specify if NTP forwarder will be configured. This will allow you to synchronize time between IBM PowerVS instances. NTP forwarder will be installed on the network-services vsi."
type = bool
default = true
}
variable "configure_nfs_server" {
description = "Specify if NFS server will be configured. This will allow you easily to share files between PowerVS instances (e.g., SAP installation files). [File storage share and mount target](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-create&interface=ui) in VPC will be created.. If yes, ensure 'nfs_server_config' optional variable is set properly below. Default value is '200GB' which will be mounted on specified directory in network-service vsi."
type = bool
default = true
}
variable "dns_forwarder_config" {
description = "Configuration for the DNS forwarder to a DNS service that is not reachable directly from PowerVS."
type = object({
dns_servers = string
})
default = {
"dns_servers" : "161.26.0.7; 161.26.0.8; 9.9.9.9;"
}
}
variable "nfs_server_config" {
description = "Configuration for the NFS server. 'size' is in GB, 'iops' is maximum input/output operation performance bandwidth per second, 'mount_path' defines the target mount point on os. Set 'configure_nfs_server' to false to ignore creating file storage share."
type = object({
size = number
iops = number
mount_path = string
})
default = {
"size" : 200,
"iops" : 600,
"mount_path" : "/nfs"
}
}
#####################################################
# Optional Parameters Monitoring and SCC WP Instance
#####################################################
variable "enable_scc_wp" {
description = "Enable SCC Workload Protection and install and configure the SCC Workload Protection agent on all intel VSIs in this deployment. If set to true, then value for 'ansible_vault_password' in optional parameter must be set."
type = bool
default = true
}
variable "enable_monitoring" {
description = "Specify whether Monitoring will be enabled. This creates a new IBM Cloud Monitoring Instance."
type = bool
default = true
}
###########################################################
# Optional Parameters Secret Manager for client to site VPN
###########################################################
variable "client_to_site_vpn" {
description = "VPN configuration - the client ip pool and list of users email ids to access the environment. If enabled, then a Secret Manager instance is also provisioned with certificates generated. See optional parameters to reuse an existing Secrets manager instance."
type = object({
enable = bool
client_ip_pool = string
vpn_client_access_group_users = list(string)
})
default = {
"enable" : true,
"client_ip_pool" : "192.168.0.0/16",
"vpn_client_access_group_users" : []
}
}
variable "sm_service_plan" {
type = string
description = "The service/pricing plan to use when provisioning a new Secrets Manager instance. Allowed values: `standard` and `trial`. Only used if `existing_sm_instance_guid` is set to null."
default = "standard"
}
variable "existing_sm_instance_guid" {
type = string
description = "An existing Secrets Manager GUID. If not provided a new instance will be provisioned."
default = null
}
variable "existing_sm_instance_region" {
type = string
description = "Required if value is passed into `var.existing_sm_instance_guid`."
default = null
}
#############################################################################
# Schematics Output
#############################################################################
# tflint-ignore: terraform_naming_convention
variable "IC_SCHEMATICS_WORKSPACE_ID" {
description = "leave blank if running locally. This variable will be automatically populated if running from an IBM Cloud Schematics workspace"
type = string
default = ""
}