Skip to content

Commit

Permalink
feat: (PSKD-709) Fix TFLint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
riragh committed Oct 24, 2024
1 parent a52f22c commit 7e4fc3c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ EOT

resource "google_filestore_instance" "rwx" {
name = "${var.prefix}-rwx-filestore"
count = var.storage_type == "ha" && var.storage_type_backend == "filestore" ? 1 : 0
count = var.storage_type == "ha" && local.storage_type_backend == "filestore" ? 1 : 0
tier = upper(var.filestore_tier)
location = local.zone
labels = var.tags
Expand Down Expand Up @@ -305,7 +305,7 @@ module "sql_proxy_sa" {
module "google_netapp" {
source = "./modules/google_netapp"

count = var.storage_type == "ha" && var.storage_type_backend == "netapp" ? 1 : 0
count = var.storage_type == "ha" && local.storage_type_backend == "netapp" ? 1 : 0

prefix = var.prefix
region = local.region
Expand Down
8 changes: 4 additions & 4 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ output "rwx_filestore_endpoint" {
description = "Shared Storage private IP"
value = (var.storage_type == "none"
? null
: var.storage_type == "ha" && var.storage_type_backend == "filestore" ? google_filestore_instance.rwx[0].networks[0].ip_addresses[0]
: var.storage_type == "ha" && var.storage_type_backend == "netapp" ? module.google_netapp[0].export_ip : module.nfs_server[0].private_ip
: var.storage_type == "ha" && local.storage_type_backend == "filestore" ? google_filestore_instance.rwx[0].networks[0].ip_addresses[0]
: var.storage_type == "ha" && local.storage_type_backend == "netapp" ? module.google_netapp[0].export_ip : module.nfs_server[0].private_ip
)
}

output "rwx_filestore_path" {
description = "Shared Storage mount path"
value = (var.storage_type == "none"
? null
: var.storage_type == "ha" && var.storage_type_backend == "filestore" ? "/${google_filestore_instance.rwx[0].file_shares[0].name}"
: var.storage_type == "ha" && var.storage_type_backend == "netapp" ? "${module.google_netapp[0].mountpath}" : "/export"
: 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"
)
}

Expand Down
8 changes: 4 additions & 4 deletions vms.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
locals {
rwx_filestore_endpoint = (var.storage_type == "none"
? ""
: var.storage_type == "ha" && var.storage_type_backend == "filestore" ? google_filestore_instance.rwx[0].networks[0].ip_addresses[0]
: var.storage_type == "ha" && var.storage_type_backend == "netapp" ? module.google_netapp[0].export_ip : module.nfs_server[0].private_ip
: var.storage_type == "ha" && local.storage_type_backend == "filestore" ? google_filestore_instance.rwx[0].networks[0].ip_addresses[0]
: var.storage_type == "ha" && local.storage_type_backend == "netapp" ? module.google_netapp[0].export_ip : module.nfs_server[0].private_ip
)
rwx_filestore_path = (var.storage_type == "none"
? ""
: var.storage_type == "ha" && var.storage_type_backend == "filestore" ? "/${google_filestore_instance.rwx[0].file_shares[0].name}"
: var.storage_type == "ha" && var.storage_type_backend == "netapp" ? "/${module.google_netapp[0].mountpath}" : "/export"
: 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"

Expand Down

0 comments on commit 7e4fc3c

Please sign in to comment.