Skip to content

Commit

Permalink
feat: switch syd04 DC to PER DC (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
surajsbharadwaj authored Apr 30, 2024
1 parent 591ca63 commit eea6c06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#####################################################

locals {
pi_per_enabled_dc_list = ["dal10", "dal12", "wdc06", "wdc07", "mad02", "mad04", "eu-de-1", "eu-de-2", "sao01", "sao04", "tok04", "osa21", "syd05", "lon06"]
pi_per_enabled = contains(local.pi_per_enabled_dc_list, var.pi_zone)
pi_non_per_dc_list = ["mon01", "tor01", "lon04", "us-south", "us-east"]
pi_per_disabled = contains(local.pi_non_per_dc_list, var.pi_zone)
}

#####################################################
Expand Down Expand Up @@ -36,7 +36,7 @@ module "powervs_workspace" {

module "powervs_cloud_connection_create" {
source = "./modules/pi-cloudconnection-create"
count = local.pi_per_enabled ? 0 : 1
count = local.pi_per_disabled ? 1 : 0

pi_zone = var.pi_zone
pi_workspace_guid = module.powervs_workspace.pi_workspace_guid
Expand All @@ -58,7 +58,7 @@ locals {
module "powervs_cloud_connection_attach" {
source = "./modules/pi-cloudconnection-attach"
depends_on = [module.powervs_cloud_connection_create]
count = local.pi_per_enabled ? 0 : 1
count = local.pi_per_disabled ? 1 : 0

pi_workspace_guid = module.powervs_workspace.pi_workspace_guid
pi_cloud_connection_count = var.pi_cloud_connection.count
Expand All @@ -74,7 +74,7 @@ module "powervs_cloud_connection_attach" {

resource "ibm_tg_connection" "tg_powervs_workspace_attach" {
depends_on = [module.powervs_workspace]
count = local.pi_per_enabled && var.pi_transit_gateway_connection.enable ? 1 : 0
count = !local.pi_per_disabled && var.pi_transit_gateway_connection.enable ? 1 : 0

name = var.pi_workspace_name
network_type = "power_virtual_server"
Expand Down
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ output "pi_public_subnet" {

output "pi_cloud_connection_count" {
description = "Number of cloud connections configured in created PowerVS infrastructure."
value = local.pi_per_enabled ? 0 : var.pi_cloud_connection.count
value = local.pi_per_disabled ? var.pi_cloud_connection.count : 0
}

output "pi_images" {
Expand Down

0 comments on commit eea6c06

Please sign in to comment.