Skip to content

Commit

Permalink
fix in compact function [skip actions]
Browse files Browse the repository at this point in the history
  • Loading branch information
elsegev committed Jul 20, 2023
1 parent da5f0e7 commit 8778298
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions examples/installation/dsf_single_account_deployment/sonar.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ locals {
tarball_location = var.tarball_location != null ? var.tarball_location : module.globals.tarball_location
agentless_gw_count = var.enable_sonar ? var.agentless_gw_count : 0

hub_cidr_list = compact([data.aws_subnet.hub_primary.cidr_block, data.aws_subnet.hub_secondary.cidr_block, try(format("%s/32", module.hub_primary[0].public_ip), null), try(format("%s/32", module.hub_secondary[0].public_ip), null)])
agentless_gw_cidr_list = [data.aws_subnet.agentless_gw_primary.cidr_block, data.aws_subnet.agentless_gw_secondary.cidr_block]
hub_primary_public_ip = length(module.hub_primary[0].public_ip) > 0 ? format("%s/32", module.hub_primary[0].public_ip) : null
hub_secondary_public_ip = length(module.hub_secondary[0].public_ip) > 0 ? format("%s/32", module.hub_secondary[0].public_ip) : null
hub_cidr_list = compact([data.aws_subnet.hub_primary.cidr_block, data.aws_subnet.hub_secondary.cidr_block, local.hub_primary_public_ip, local.hub_secondary_public_ip])
agentless_gw_cidr_list = [data.aws_subnet.agentless_gw_primary.cidr_block, data.aws_subnet.agentless_gw_secondary.cidr_block]
}

module "hub_primary" {
Expand Down
6 changes: 4 additions & 2 deletions examples/poc/dsf_deployment/sonar.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ locals {
tarball_location = module.globals.tarball_location
agentless_gw_count = var.enable_sonar ? var.agentless_gw_count : 0

hub_cidr_list = compact([data.aws_subnet.hub.cidr_block, data.aws_subnet.hub_secondary.cidr_block, try(format("%s/32", module.hub[0].public_ip), null), try(format("%s/32", module.hub_secondary[0].public_ip), null)])
agentless_gw_cidr_list = [data.aws_subnet.agentless_gw.cidr_block, data.aws_subnet.agentless_gw_secondary.cidr_block]
hub_public_ip = length(module.hub[0].public_ip) > 0 ? format("%s/32", module.hub[0].public_ip) : null
hub_secondary_public_ip = length(module.hub_secondary[0].public_ip) > 0 ? format("%s/32", module.hub_secondary[0].public_ip) : null
hub_cidr_list = compact([data.aws_subnet.hub.cidr_block, data.aws_subnet.hub_secondary.cidr_block, local.hub_public_ip, local.hub_secondary_public_ip])
agentless_gw_cidr_list = [data.aws_subnet.agentless_gw.cidr_block, data.aws_subnet.agentless_gw_secondary.cidr_block]
}

module "hub" {
Expand Down

0 comments on commit 8778298

Please sign in to comment.