From 7923b06815561568998e6662d57a7f4811ac3d62 Mon Sep 17 00:00:00 2001 From: Paul Bastide Date: Tue, 14 Nov 2023 16:21:11 -0500 Subject: [PATCH] OCTOPUS-555: harden the skip for routes Signed-off-by: Paul Bastide --- modules/1_vpc_prepare/routes.tf | 1 + modules/1_vpc_prepare/variables.tf | 3 ++- variables.tf | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/1_vpc_prepare/routes.tf b/modules/1_vpc_prepare/routes.tf index 3d4a5ac..0cdfbd5 100644 --- a/modules/1_vpc_prepare/routes.tf +++ b/modules/1_vpc_prepare/routes.tf @@ -4,6 +4,7 @@ ################################################################ resource "ibm_is_vpc_routing_table_route" "route_to_powervs" { + count = var.skip_route_creation ? 0 : 1 vpc = data.ibm_is_vpc.vpc.id routing_table = data.ibm_is_vpc.vpc.default_routing_table zone = var.vpc_create || var.create_custom_subnet ? ibm_is_subnet.subnet_worker_zone_1[0].zone : data.ibm_is_vpc.vpc.subnets[0].zone diff --git a/modules/1_vpc_prepare/variables.tf b/modules/1_vpc_prepare/variables.tf index 4b598cd..12054a4 100644 --- a/modules/1_vpc_prepare/variables.tf +++ b/modules/1_vpc_prepare/variables.tf @@ -60,4 +60,5 @@ variable "bastion_public_ip" {} variable "private_key_file" {} variable "connection_timeout" {} variable "rhel_username" {} -variable "skip_create_security_group" {} \ No newline at end of file +variable "skip_create_security_group" {} +variable "skip_route_creation" {} \ No newline at end of file diff --git a/variables.tf b/variables.tf index 371edb7..70010db 100644 --- a/variables.tf +++ b/variables.tf @@ -339,3 +339,9 @@ variable "skip_create_security_group" { default = false } +variable "skip_route_creation" { + type = bool + description = "skips the creation of the route table entry in a vpc environment" + default = false +} +