Skip to content

Commit

Permalink
OCTOPUS-534: refactor the subnet layout and resource group usage so i…
Browse files Browse the repository at this point in the history
…t fails early with a relevant message

Signed-off-by: Paul Bastide <[email protected]>
  • Loading branch information
prb112 committed Nov 8, 2023
1 parent 27e167d commit deec1be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
24 changes: 11 additions & 13 deletions modules/0_vpc/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
# Dev Note: This is the file where the VPC should be created in the future.
# The code should follow the checks, and conditionally create the vpc.
# outputs need to be updated and passed back to the user.
### create
module "create" {
count = var.vpc_create ? 1 : 0
providers = {
ibm = ibm
}
source = "./create"

vpc_name = var.vpc_name
vpc_resource_group = var.vpc_resource_group
}

module "reuse" {
count = var.vpc_create ? 0 : 1
Expand All @@ -25,17 +36,4 @@ module "reuse" {
powervs_region = var.powervs_region
powervs_zone = var.powervs_zone
override_region_check = var.override_region_check
}


### create
module "create" {
count = var.vpc_create ? 1 : 0
providers = {
ibm = ibm
}
source = "./create"

vpc_name = var.vpc_name
vpc_resource_group = var.vpc_resource_group
}
1 change: 0 additions & 1 deletion modules/1_vpc_prepare/subnets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ resource "ibm_is_subnet_public_gateway_attachment" "attach_pg_worker_zone_1" {
}

### Zone 2

resource "ibm_is_vpc_address_prefix" "address_prefix_worker_zone_2" {
count = var.create_custom_subnet ? 1 : 0
cidr = "10.0.2.0/24"
Expand Down

0 comments on commit deec1be

Please sign in to comment.