Skip to content

Commit df1b98a

Browse files
authored
test: Fixed advanced example to handle ingress check (#469)
* fix: fixed advanced example to handle ingress check SKIP UPGRADE TEST * fix: fixed gateways
1 parent 66c0fa0 commit df1b98a

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

examples/advanced/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The following resources are provisioned by this example:
66
- A new resource group, if an existing one is not passed in.
77
- A Key Protect instance with 2 root keys, one for cluster encryption, and one for worker block storage encryption.
88
- A VPC with subnets across 3 zones.
9-
- A public gateway only in zone-1.
9+
- A public gateway for all the three zones
1010
- A multi-zone (3 zone) KMS encrypted OCP VPC cluster, with worker pools in each zone.
1111
- Auto scaling enabled for the default worker pool.
1212
- Taints against the workers in zone-2 and zone-3.

examples/advanced/main.tf

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,16 @@ resource "ibm_is_vpc" "vpc" {
5656
########################################################################################################################
5757

5858
resource "ibm_is_public_gateway" "gateway" {
59-
name = "${var.prefix}-gateway-1"
59+
for_each = toset(["1", "2", "3"])
60+
name = "${var.prefix}-gateway-${each.key}"
6061
vpc = ibm_is_vpc.vpc.id
6162
resource_group = module.resource_group.resource_group_id
62-
zone = "${var.region}-1"
63+
zone = "${var.region}-${each.key}"
6364
}
6465

6566
########################################################################################################################
66-
# Subnets accross 3 zones (pub gw only attached to zone-1)
67+
# Subnets accross 3 zones
68+
# Public gateway attached to all the zones
6769
########################################################################################################################
6870

6971
resource "ibm_is_subnet" "subnets" {
@@ -73,8 +75,7 @@ resource "ibm_is_subnet" "subnets" {
7375
resource_group = module.resource_group.resource_group_id
7476
zone = "${var.region}-${each.key}"
7577
total_ipv4_address_count = 256
76-
# for this example, gateway only goes on zone-1
77-
public_gateway = (each.key == "1") ? ibm_is_public_gateway.gateway.id : null
78+
public_gateway = ibm_is_public_gateway.gateway[each.key].id
7879
}
7980

8081
########################################################################################################################

0 commit comments

Comments
 (0)