Skip to content

Commit 1c32999

Browse files
robo-caphyder
authored andcommitted
allow user to add additional rules to the workers NSG
1 parent 02aeaeb commit 1c32999

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

examples/network/vars-network.auto.tfvars

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ allow_rules_public_lb = {
5353
# },
5454
}
5555

56+
allow_rules_workers = {
57+
# "Allow TCP ingress to workers for port 8080 from VCN" : {
58+
# protocol = 6, port = 8080, source = "10.0.0.0/16", source_type = "CIDR_BLOCK",
59+
# },
60+
}
61+
5662
# Dynamic routing gateway (DRG)
5763
create_drg = false # true/*false
5864
drg_display_name = "drg"

module-network.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ module "network" {
115115
allow_pod_internet_access = var.allow_pod_internet_access
116116
allow_rules_internal_lb = var.allow_rules_internal_lb
117117
allow_rules_public_lb = var.allow_rules_public_lb
118+
allow_rules_workers = var.allow_rules_workers
118119
allow_worker_internet_access = var.allow_worker_internet_access
119120
allow_worker_ssh_access = var.allow_worker_ssh_access
120121
allow_bastion_cluster_access = var.allow_bastion_cluster_access

modules/network/nsg-workers.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ locals {
112112
"Allow UDP egress from workers for NFS to FSS mounts" : {
113113
protocol = local.udp_protocol, port = local.fss_nfs_port_min, destination = local.fss_nsg_id, destination_type = local.rule_type_nsg,
114114
},
115-
} : {}) : {}
115+
} : {},
116+
var.allow_rules_workers
117+
) : {}
116118
}
117119

118120
resource "oci_core_network_security_group" "workers" {

modules/network/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ variable "allow_node_port_access" { type = bool }
1616
variable "allow_pod_internet_access" { type = bool }
1717
variable "allow_rules_internal_lb" { type = any }
1818
variable "allow_rules_public_lb" { type = any }
19+
variable "allow_rules_workers" { type = any }
1920
variable "allow_worker_internet_access" { type = bool }
2021
variable "allow_worker_ssh_access" { type = bool }
2122
variable "allow_bastion_cluster_access" { type = bool }

variables-network.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,12 @@ variable "allow_rules_public_lb" {
262262
type = any
263263
}
264264

265+
variable "allow_rules_workers" {
266+
default = {}
267+
description = "A map of additional rules to allow traffic for the workers."
268+
type = any
269+
}
270+
265271
variable "control_plane_allowed_cidrs" {
266272
default = []
267273
description = "The list of CIDR blocks from which the control plane can be accessed."

0 commit comments

Comments
 (0)