Skip to content

Commit

Permalink
test: Fixed advanced example to handle ingress check (#469)
Browse files Browse the repository at this point in the history
* fix: fixed advanced example to handle ingress check SKIP UPGRADE TEST

* fix: fixed gateways
  • Loading branch information
vbontempi authored Jun 28, 2024
1 parent 66c0fa0 commit df1b98a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/advanced/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The following resources are provisioned by this example:
- A new resource group, if an existing one is not passed in.
- A Key Protect instance with 2 root keys, one for cluster encryption, and one for worker block storage encryption.
- A VPC with subnets across 3 zones.
- A public gateway only in zone-1.
- A public gateway for all the three zones
- A multi-zone (3 zone) KMS encrypted OCP VPC cluster, with worker pools in each zone.
- Auto scaling enabled for the default worker pool.
- Taints against the workers in zone-2 and zone-3.
11 changes: 6 additions & 5 deletions examples/advanced/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,16 @@ resource "ibm_is_vpc" "vpc" {
########################################################################################################################

resource "ibm_is_public_gateway" "gateway" {
name = "${var.prefix}-gateway-1"
for_each = toset(["1", "2", "3"])
name = "${var.prefix}-gateway-${each.key}"
vpc = ibm_is_vpc.vpc.id
resource_group = module.resource_group.resource_group_id
zone = "${var.region}-1"
zone = "${var.region}-${each.key}"
}

########################################################################################################################
# Subnets accross 3 zones (pub gw only attached to zone-1)
# Subnets accross 3 zones
# Public gateway attached to all the zones
########################################################################################################################

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

########################################################################################################################
Expand Down

0 comments on commit df1b98a

Please sign in to comment.