Skip to content

Commit

Permalink
feat: added new input ignore_vpcs_for_cluster_deployment to the OCP…
Browse files Browse the repository at this point in the history
… 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)
  • Loading branch information
toddgiguere authored Sep 18, 2024
1 parent 5ec7d26 commit 3b9d896
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions patterns/roks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module "roks_landing_zone" {
wait_till = var.wait_till
network_cidr = var.network_cidr
vpcs = var.vpcs
ignore_vpcs_for_cluster_deployment = var.ignore_vpcs_for_cluster_deployment
enable_transit_gateway = var.enable_transit_gateway
transit_gateway_global = var.transit_gateway_global
ssh_public_key = var.ssh_public_key
Expand Down
5 changes: 4 additions & 1 deletion patterns/roks/module/config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,17 @@ locals {
# Dynamic configuration for landing zone environment
##############################################################################

# create cluster vpc list by subtracting names from supplied ignore list
cluster_vpcs = setsubtract(var.vpcs, var.ignore_vpcs_for_cluster_deployment)

config = {

##############################################################################
# Cluster Config
##############################################################################
clusters = [
# Dynamically create identical cluster in each VPC
for network in var.vpcs :
for network in local.cluster_vpcs :
{
name = "${network}-cluster"
vpc_name = network
Expand Down
7 changes: 7 additions & 0 deletions patterns/roks/module/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ variable "vpcs" {
}
}

variable "ignore_vpcs_for_cluster_deployment" {
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`."
type = list(string)
default = []
nullable = false
}

variable "enable_transit_gateway" {
description = "Create transit gateway"
type = bool
Expand Down
7 changes: 7 additions & 0 deletions patterns/roks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ variable "vpcs" {
}
}

variable "ignore_vpcs_for_cluster_deployment" {
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`."
type = list(string)
default = []
nullable = false
}

variable "enable_transit_gateway" {
description = "Create transit gateway"
type = bool
Expand Down

0 comments on commit 3b9d896

Please sign in to comment.