Skip to content

Commit

Permalink
OCTOPUS-558: Invalid count argument error is resolved
Browse files Browse the repository at this point in the history
Signed-off-by: Chandan Abhyankar <chandan.abhyankar@gmail.com>
  • Loading branch information
Chandan-Abhyankar committed Dec 19, 2023
1 parent 93c2825 commit fe92108
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ module "vpc_prepare" {
create_custom_subnet = var.create_custom_subnet
skip_create_security_group = var.skip_create_security_group
skip_route_creation = var.skip_route_creation
ibm_cloud_cis = var.ibm_cloud_cis
}

### Prepares the VPC gateway
Expand Down
6 changes: 3 additions & 3 deletions modules/1_vpc_prepare/security_groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ locals {
# Dev Note: Only opens to the Load Balancers SG
# If it exists, it implies that the SG needs to be updated.
resource "ibm_is_security_group_rule" "lbs_to_workers_http" {
count = length(local.lbs_sg) > 0 ? 1 : 0
count = var.ibm_cloud_cis ? 1 : 0
group = ibm_is_security_group.worker_vm_sg[0].id
direction = "inbound"
remote = local.lbs_sg[0].id
Expand All @@ -85,12 +85,12 @@ resource "ibm_is_security_group_rule" "lbs_to_workers_http" {

# TCP Inbound 443 - Security group *ocp-sec-group
resource "ibm_is_security_group_rule" "lbs_to_workers_https" {
count = length(local.lbs_sg) > 0 ? 1 : 0
count = var.ibm_cloud_cis ? 1 : 0
group = ibm_is_security_group.worker_vm_sg[0].id
direction = "inbound"
remote = local.lbs_sg[0].id
tcp {
port_min = 443
port_max = 443
}
}
}
3 changes: 2 additions & 1 deletion modules/1_vpc_prepare/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ variable "public_key" {}
variable "powervs_machine_cidr" {}
variable "resource_group" {}
variable "name_prefix" {}
variable "ibm_cloud_cis" {}

variable "worker_1" {
type = object({ count = number, profile = string, zone = string })
Expand Down Expand Up @@ -61,4 +62,4 @@ variable "private_key_file" {}
variable "connection_timeout" {}
variable "rhel_username" {}
variable "skip_create_security_group" {}
variable "skip_route_creation" {}
variable "skip_route_creation" {}

0 comments on commit fe92108

Please sign in to comment.