cloud-foundation-fabric/modules/gcve-private-cloud/variables.tf

110 lines
3.3 KiB
Terraform
Raw Normal View History

2023-08-14 02:48:27 -07:00
/**
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
variable "description" {
description = "Private cloud description."
type = string
default = "Terraform-managed."
}
2023-08-18 02:20:27 -07:00
variable "cidr" {
2023-08-17 03:25:33 -07:00
description = "vSphere/vSAN subnets CIDR range. To undersatnd the limits, please refer to [GCVE network requirements](https://cloud.google.com/vmware-engine/docs/quickstart-networking-requirements)."
2023-08-14 02:48:27 -07:00
type = string
}
variable "management_cluster_config" {
description = "Management cluster configuration."
type = object({
node_type_id = string
node_count = number,
custom_core_count = number
})
default = {
node_type_id = "standard-72",
node_count = 3,
custom_core_count = null
}
2023-08-18 02:20:27 -07:00
nullable = false
2023-08-14 02:48:27 -07:00
}
variable "name" {
description = "Private cloud name."
type = string
}
variable "private_connections" {
description = "VMWare private connections configuration. It is used to create the gcloud command printed as output."
type = map(object({
2023-08-18 06:38:35 -07:00
name = string
network_self_link = string
peering_name = optional(string)
tenant_host_project = optional(string)
description = optional(string, "Terraform-managed.")
type = optional(string, "PRIVATE_SERVICE_ACCESS")
routing_mode = optional(string, "REGIONAL")
2023-08-14 02:48:27 -07:00
}))
2023-08-18 02:20:27 -07:00
default = {}
nullable = false
2023-08-18 06:38:35 -07:00
validation {
condition = alltrue([
for k, v in var.private_connections :
(v.peering_name != null) != (v.tenant_host_project != null)
]
)
error_message = "Both peering_name and tenant_host_project variables have been set. Only one variable is allowed."
}
2023-08-14 02:48:27 -07:00
validation {
condition = alltrue([
for r in var.private_connections :
contains(["GLOBAL", "REGIONAL"], r.routing_mode)
])
error_message = "Routing mode must be one of GLOBAL, REGIONAL."
}
validation {
condition = alltrue([
for r in var.private_connections :
contains(["DELL_POWERSCALE", "NETAPP_CLOUD_VOLUMES", "PRIVATE_SERVICE_ACCESS", "THIRD_PARTY_SERVICE"], r.type)
])
error_message = "Type must be one of DELL_POWERSCALE, NETAPP_CLOUD_VOLUMES, PRIVATE_SERVICE_ACCESS, THIRD_PARTY_SERVICE."
}
}
variable "project_id" {
description = "Project id."
type = string
}
2023-08-17 00:37:48 -07:00
variable "vmw_network_create" {
2023-08-14 02:48:27 -07:00
description = "Create the VMware Engine network. When set to false, it uses a data source to reference an existing VMware Engine network."
type = bool
default = true
}
2023-08-17 00:37:48 -07:00
variable "vmw_network_description" {
description = " VMware Engine network description."
type = string
default = "Terraform-managed."
}
2023-08-14 02:48:27 -07:00
variable "zone" {
description = "Private cloud zone."
type = string
}