From 86c9c736290c883256d672a95b08255e2f4d5260 Mon Sep 17 00:00:00 2001 From: Ritika Patil Date: Thu, 24 Oct 2024 15:03:54 -0500 Subject: [PATCH] feat: (PSKD-709) Additional updates and clean up --- main.tf | 13 ++++++------- modules/google_netapp/outputs.tf | 2 +- modules/google_netapp/variables.tf | 6 ------ variables.tf | 8 +------- vms.tf | 4 ++-- 5 files changed, 10 insertions(+), 23 deletions(-) diff --git a/main.tf b/main.tf index 1eb9c47..a301284 100644 --- a/main.tf +++ b/main.tf @@ -307,13 +307,12 @@ module "google_netapp" { count = var.storage_type == "ha" && local.storage_type_backend == "netapp" ? 1 : 0 - prefix = var.prefix - region = local.region - network = module.vpc.network_name - service_level = var.netapp_service_level - capacity_gib = var.netapp_capacity_gib - protocols = var.netapp_protocols - # netapp_subnet_cidr = var.netapp_subnet_cidr + prefix = var.prefix + region = local.region + network = module.vpc.network_name + service_level = var.netapp_service_level + capacity_gib = var.netapp_capacity_gib + protocols = var.netapp_protocols volume_path = "${var.prefix}-${var.netapp_volume_path}" allowed_clients = join(",", [local.gke_subnet_cidr, local.misc_subnet_cidr]) } diff --git a/modules/google_netapp/outputs.tf b/modules/google_netapp/outputs.tf index f6d1cac..71fc2df 100644 --- a/modules/google_netapp/outputs.tf +++ b/modules/google_netapp/outputs.tf @@ -4,4 +4,4 @@ output "mountpath" { output "export_ip" { value = split(":", google_netapp_volume.netapp-nfs-volume.mount_options[0].export_full)[0] -} \ No newline at end of file +} diff --git a/modules/google_netapp/variables.tf b/modules/google_netapp/variables.tf index 9110602..fd04608 100644 --- a/modules/google_netapp/variables.tf +++ b/modules/google_netapp/variables.tf @@ -46,9 +46,3 @@ variable "allowed_clients" { type = string default = "0.0.0.0/0" } - -# variable "netapp_subnet_cidr" { -# description = "Address space for Google NetApp Volumes subnet" -# type = string -# default = "192.168.5.0/24" -# } diff --git a/variables.tf b/variables.tf index 8ccaf17..a9ad986 100644 --- a/variables.tf +++ b/variables.tf @@ -192,7 +192,7 @@ variable "storage_type_backend" { validation { condition = contains(["nfs", "filestore", "netapp", "none"], lower(var.storage_type_backend)) - error_message = "ERROR: Supported values for `storage_type_backend` are nfs, filestore, netapp and none." + error_message = "ERROR: Supported values for `storage_type_backend` are nfs, filestore, netapp or none." } } @@ -566,12 +566,6 @@ variable "database_subnet_cidr" { default = "192.168.4.0/23" } -# variable "netapp_subnet_cidr" { -# description = "Address space for Google NetApp Volumes subnet" -# type = string -# default = "192.168.5.0/24" -# } - variable "gke_network_policy" { description = "Sets up network policy to be used with GKE CNI. Network policy allows us to control the traffic flow between pods. Currently supported values are true (calico) and false (kubenet). Changing this forces a new resource to be created." type = bool diff --git a/vms.tf b/vms.tf index 614b340..dbb626b 100644 --- a/vms.tf +++ b/vms.tf @@ -12,14 +12,14 @@ locals { : var.storage_type == "ha" && local.storage_type_backend == "filestore" ? "/${google_filestore_instance.rwx[0].file_shares[0].name}" : var.storage_type == "ha" && local.storage_type_backend == "netapp" ? "/${module.google_netapp[0].mountpath}" : "/export" ) - protocol_version = var.storage_type == "ha" && var.storage_type_backend == "netapp" ? split("V", var.netapp_protocols[0])[1] == "4" ? "4.1" : "3" : "3" + protocol_version = var.storage_type == "ha" && local.storage_type_backend == "netapp" ? split("V", var.netapp_protocols[0])[1] == "4" ? "4.1" : "3" : "3" } module "nfs_server" { source = "./modules/google_vm" project = var.project - count = var.storage_type == "standard" && var.storage_type_backend == "nfs" ? 1 : 0 + count = var.storage_type == "standard" && local.storage_type_backend == "nfs" ? 1 : 0 create_public_ip = var.create_nfs_public_ip name = "${var.prefix}-nfs-server"