Skip to content

Commit

Permalink
allow user to add additional rules to the workers NSG
Browse files Browse the repository at this point in the history
  • Loading branch information
robo-cap authored and hyder committed Jul 3, 2024
1 parent 02aeaeb commit 1c32999
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions examples/network/vars-network.auto.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ allow_rules_public_lb = {
# },
}

allow_rules_workers = {
# "Allow TCP ingress to workers for port 8080 from VCN" : {
# protocol = 6, port = 8080, source = "10.0.0.0/16", source_type = "CIDR_BLOCK",
# },
}

# Dynamic routing gateway (DRG)
create_drg = false # true/*false
drg_display_name = "drg"
Expand Down
1 change: 1 addition & 0 deletions module-network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ module "network" {
allow_pod_internet_access = var.allow_pod_internet_access
allow_rules_internal_lb = var.allow_rules_internal_lb
allow_rules_public_lb = var.allow_rules_public_lb
allow_rules_workers = var.allow_rules_workers
allow_worker_internet_access = var.allow_worker_internet_access
allow_worker_ssh_access = var.allow_worker_ssh_access
allow_bastion_cluster_access = var.allow_bastion_cluster_access
Expand Down
4 changes: 3 additions & 1 deletion modules/network/nsg-workers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ locals {
"Allow UDP egress from workers for NFS to FSS mounts" : {
protocol = local.udp_protocol, port = local.fss_nfs_port_min, destination = local.fss_nsg_id, destination_type = local.rule_type_nsg,
},
} : {}) : {}
} : {},
var.allow_rules_workers
) : {}
}

resource "oci_core_network_security_group" "workers" {
Expand Down
1 change: 1 addition & 0 deletions modules/network/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ variable "allow_node_port_access" { type = bool }
variable "allow_pod_internet_access" { type = bool }
variable "allow_rules_internal_lb" { type = any }
variable "allow_rules_public_lb" { type = any }
variable "allow_rules_workers" { type = any }
variable "allow_worker_internet_access" { type = bool }
variable "allow_worker_ssh_access" { type = bool }
variable "allow_bastion_cluster_access" { type = bool }
Expand Down
6 changes: 6 additions & 0 deletions variables-network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ variable "allow_rules_public_lb" {
type = any
}

variable "allow_rules_workers" {
default = {}
description = "A map of additional rules to allow traffic for the workers."
type = any
}

variable "control_plane_allowed_cidrs" {
default = []
description = "The list of CIDR blocks from which the control plane can be accessed."
Expand Down

0 comments on commit 1c32999

Please sign in to comment.