Use new resources in GCVE module, bump up provider versions (#1941)

This commit is contained in:
Luca Prete
2023-12-21 14:23:38 +01:00
committed by GitHub
parent 110fd798a7
commit c4123044b7
83 changed files with 694 additions and 543 deletions

View File

@@ -13,96 +13,76 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
variable "cidr" {
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)."
variable "prefix" {
description = "Resources name prefix."
type = string
}
variable "description" {
description = "Private cloud description."
type = string
default = "Terraform-managed."
}
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
}
nullable = false
}
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({
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")
}))
default = {}
nullable = false
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."
}
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
}
variable "vmw_network_create" {
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
variable "vmw_network_config" {
description = "VMware Engine network configuration."
type = object({
create = optional(bool, true)
description = optional(string, "Terraform-managed.")
name = optional(string, "default")
})
default = {}
}
variable "vmw_network_description" {
description = " VMware Engine network description."
type = string
default = "Terraform-managed."
variable "vmw_network_peerings" {
description = "The network peerings towards users' VPCs or other VMware Engine networks. The key is the peering name suffix."
type = map(object({
peer_network = string
description = optional(string, "Managed by Terraform.")
export_custom_routes = optional(bool, false)
export_custom_routes_with_public_ip = optional(bool, false)
import_custom_routes = optional(bool, false)
import_custom_routes_with_public_ip = optional(bool, false)
peer_to_vmware_engine_network = optional(bool, false)
}))
default = {}
}
variable "zone" {
description = "Private cloud zone."
type = string
variable "vmw_private_cloud_configs" {
description = "The VMware private cloud configurations. The key is the unique private cloud name suffix."
type = map(object({
cidr = string
zone = string
# The key is the unique additional cluster name suffix
additional_cluster_configs = optional(map(object({
custom_core_count = optional(number)
node_count = optional(number, 3)
node_type_id = optional(string, "standard-72")
})), {})
management_cluster_config = optional(object({
custom_core_count = optional(number)
name = optional(string, "mgmt-cluster")
node_count = optional(number, 3)
node_type_id = optional(string, "standard-72")
}), {})
description = optional(string, "Managed by Terraform.")
}))
default = {
pcc_one = {
cidr = "192.168.0.0/24"
additional_cluster_configs = {
test-cluster-one = {
node_type_id = "standard-72"
node_count = 6
custom_core_count = 28
}
test-cluster-two = {
node_type_id = "standard-72"
node_count = 4
custom_core_count = 28
}
}
zone = "europe-west8-a"
}
}
}