Skip to content

Commit 3b9d896

Browse files
authored
feat: added new input ignore_vpcs_for_cluster_deployment to the OCP standard DA to allow you to specify a VPC that you do not wish to create a cluster in. By default a cluster will be created in all of the VPCs specified in the vpcs input. (#881)
1 parent 5ec7d26 commit 3b9d896

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

patterns/roks/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module "roks_landing_zone" {
2727
wait_till = var.wait_till
2828
network_cidr = var.network_cidr
2929
vpcs = var.vpcs
30+
ignore_vpcs_for_cluster_deployment = var.ignore_vpcs_for_cluster_deployment
3031
enable_transit_gateway = var.enable_transit_gateway
3132
transit_gateway_global = var.transit_gateway_global
3233
ssh_public_key = var.ssh_public_key

patterns/roks/module/config.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,17 @@ locals {
6868
# Dynamic configuration for landing zone environment
6969
##############################################################################
7070

71+
# create cluster vpc list by subtracting names from supplied ignore list
72+
cluster_vpcs = setsubtract(var.vpcs, var.ignore_vpcs_for_cluster_deployment)
73+
7174
config = {
7275

7376
##############################################################################
7477
# Cluster Config
7578
##############################################################################
7679
clusters = [
7780
# Dynamically create identical cluster in each VPC
78-
for network in var.vpcs :
81+
for network in local.cluster_vpcs :
7982
{
8083
name = "${network}-cluster"
8184
vpc_name = network

patterns/roks/module/variables.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ variable "vpcs" {
5050
}
5151
}
5252

53+
variable "ignore_vpcs_for_cluster_deployment" {
54+
description = "List of VPCs from input `vpcs` that should be ignored when deploying OpenShift clusters. If empty then a cluster will be deployed in all VPCs specified in input `vpcs`."
55+
type = list(string)
56+
default = []
57+
nullable = false
58+
}
59+
5360
variable "enable_transit_gateway" {
5461
description = "Create transit gateway"
5562
type = bool

patterns/roks/variables.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ variable "vpcs" {
5656
}
5757
}
5858

59+
variable "ignore_vpcs_for_cluster_deployment" {
60+
description = "List of VPCs from input `vpcs` that should be ignored when deploying OpenShift clusters. If empty then a cluster will be deployed in all VPCs specified in input `vpcs`."
61+
type = list(string)
62+
default = []
63+
nullable = false
64+
}
65+
5966
variable "enable_transit_gateway" {
6067
description = "Create transit gateway"
6168
type = bool

0 commit comments

Comments
 (0)