Skip to content

Commit 8bbf266

Browse files
authored
feat: added output for all nsg ids in a map. Previous nsg outputs are deprecated (#550)
feat: added output for all nsg ids in a map. Previous nsg outputs are deprecated Signed-off-by: Ali Mukadam <ali.mukadam@oracle.com>
1 parent 5f3e3d1 commit 8bbf266

File tree

3 files changed

+20
-23
lines changed

3 files changed

+20
-23
lines changed

modules/network/nsgs.tf

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -440,27 +440,6 @@ resource "oci_core_network_security_group_security_rule" "int_lb_ingress" {
440440
count = var.load_balancers == "internal" || var.load_balancers == "both" ? length(local.internal_lb_allowed_cidrs_and_ports) : 0
441441
}
442442

443-
# add this rule separately so it can be controlled independently
444-
# resource "oci_core_network_security_group_security_rule" "int_lb_healthcheck_ingress_from_pub_lb" {
445-
# network_security_group_id = oci_core_network_security_group.int_lb[0].id
446-
# description = "Allow healthchecks from public load balancers"
447-
# direction = "INGRESS"
448-
# protocol = local.tcp_protocol
449-
# source = local.pub_lb_subnet
450-
# source_type = "CIDR_BLOCK"
451-
452-
# stateless = false
453-
454-
# tcp_options {
455-
# destination_port_range {
456-
# min = length(regexall("-", element(var.internal_lb_allowed_ports, count.index))) > 0 ? tonumber(element(split("-", element(var.internal_lb_allowed_ports, count.index)), 0)) : element(var.internal_lb_allowed_ports, count.index)
457-
# max = length(regexall("-", element(var.internal_lb_allowed_ports, count.index))) > 0 ? tonumber(element(split("-", element(var.internal_lb_allowed_ports, count.index)), 1)) : element(var.internal_lb_allowed_ports, count.index)
458-
# }
459-
# }
460-
461-
# count = var.load_balancers == "both" ? length(var.internal_lb_allowed_ports) : 0
462-
# }
463-
464443
# public lb nsg and rules
465444
resource "oci_core_network_security_group" "pub_lb" {
466445
compartment_id = var.compartment_id

modules/network/outputs.tf

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,24 @@
44
output "subnet_ids" {
55
value = {
66
"cp" = join(",", oci_core_subnet.cp[*].id)
7-
"pods" = join(",", oci_core_subnet.pods[*].id)
7+
"pods" = join(",", oci_core_subnet.pods[*].id)
88
"workers" = join(",", oci_core_subnet.workers[*].id)
99
"int_lb" = join(",", oci_core_subnet.int_lb[*].id)
1010
"pub_lb" = join(",", oci_core_subnet.pub_lb[*].id)
1111
}
1212
}
1313

14+
output "nsg_ids" {
15+
value = {
16+
"cp" = join(",", oci_core_network_security_group.cp[*].id)
17+
"pods" = join(",", oci_core_network_security_group.pods[*].id)
18+
"workers" = join(",", oci_core_network_security_group.workers[*].id)
19+
"int_lb" = join(",", oci_core_network_security_group.int_lb[*].id)
20+
"pub_lb" = join(",", oci_core_network_security_group.pub_lb[*].id)
21+
22+
}
23+
}
24+
1425
output "control_plane_nsg_id" {
1526
value = oci_core_network_security_group.cp.id
1627
}

outputs.tf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,25 @@ output "nat_route_id" {
2323
value = local.nat_route_id
2424
}
2525

26+
# Deprecated
2627
output "int_lb_nsg" {
2728
description = "id of default NSG that can be associated with the internal load balancer"
2829
value = module.network.int_lb
2930
}
3031

32+
output "nsg_ids" {
33+
description = "map of NSG ids (cp, worker, int_lb, pub_lb, pod) used by OKE."
34+
value = module.network.nsg_ids
35+
}
36+
37+
# Deprecated
3138
output "pub_lb_nsg" {
3239
description = "id of default NSG that can be associated with the internal load balancer"
3340
value = module.network.pub_lb
3441
}
3542

3643
output "subnet_ids" {
37-
description = "map of subnet ids (worker, int_lb, pub_lb) used by OKE."
44+
description = "map of subnet ids (cp, worker, int_lb, pub_lb, pod) used by OKE."
3845
value = module.network.subnet_ids
3946
}
4047

0 commit comments

Comments
 (0)