Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow user to add additional rules to the workers NSG #937

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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