From b08f03ea8f841027d8c185cc2be7a0ee46664990 Mon Sep 17 00:00:00 2001 From: Steve Peggs Date: Wed, 8 Nov 2023 22:43:23 +0000 Subject: [PATCH 1/2] fix: add reserved ip names for gateways --- main.tf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index b7650036..c9055c56 100644 --- a/main.tf +++ b/main.tf @@ -37,6 +37,7 @@ locals { ip_name = "${subnet.name}-${service.service_name}-gateway-${replace(subnet.zone, "/${var.region}-/", "")}-ip" subnet_id = subnet.id gateway_name = service.vpe_name != null ? service.vpe_name : "${var.prefix}-${var.vpc_name}-${service.service_name}" + name = service.vpe_name != null ? "${service.vpe_name}-${replace(subnet.zone, "/${var.region}-/", "")}" : "${var.prefix}-${var.vpc_name}-${service.service_name}-${replace(subnet.zone, "/${var.region}-/", "")}" } ], [ @@ -45,6 +46,7 @@ locals { ip_name = service.vpe_name != null ? "${subnet.name}-${service.vpe_name}-gateway-${replace(subnet.zone, "/${var.region}-/", "")}-ip" : "${subnet.name}-${service.service_name != null ? service.service_name : element(split(":", service.crn), 4)}-gateway-${replace(subnet.zone, "/${var.region}-/", "")}-ip" subnet_id = subnet.id gateway_name = service.vpe_name != null ? service.vpe_name : "${var.prefix}-${var.vpc_name}-${service.service_name != null ? service.service_name : element(split(":", service.crn), 4)}" + name = service.vpe_name != null ? "${service.vpe_name}-${replace(subnet.zone, "/${var.region}-/", "")}" : "${var.prefix}-${var.vpc_name}-${service.service_name != null ? service.service_name : element(split(":", service.crn), 4)}-${replace(subnet.zone, "/${var.region}-/", "")}" } ]) ]) @@ -69,7 +71,7 @@ resource "ibm_is_subnet_reserved_ip" "ip" { for gateway_ip in local.endpoint_ip_list : (gateway_ip.ip_name) => gateway_ip } - # name # Tracked at https://github.com/terraform-ibm-modules/terraform-ibm-vpe-gateway/issues/435 + name = each.value.name subnet = each.value.subnet_id } From da54735fefeb0b6875a43c675026ffc3130adcce Mon Sep 17 00:00:00 2001 From: Steve Peggs Date: Wed, 15 Nov 2023 17:52:56 +0000 Subject: [PATCH 2/2] fix: SKIP UPGRADE TEST --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6219fced..0ba13c05 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,10 @@ The module supports the following actions: - Create reserved IP addresses - Attach endpoint gateways to reserved IP addresses +### Known provider issues + +An IBM Provider [issue](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/4927) has been raised that impacts this module. When changing the name of reserved ip addresses for the VPE gateways, the outputs of this module may not be updated in the terraform state file. When this issue occurs, run a `terraform apply -refresh-only` to update the terraform state. + ## Overview