Skip to content

Rename sg_ports.tf and clean up duplicate rules #42

Merged
merged 2 commits into from
Apr 17, 2025
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
21 changes: 21 additions & 0 deletions additional_sg_rules.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
locals {
node_security_group_additional_rules = {
ingress_nodes_ephemeral = {
description = "Node to node ingress on ephemeral ports"
from_port = 80
protocol = "tcp"
self = true
to_port = 65535
type = "ingress"
}
# ALB controller, NGINX
ingress_cluster_9443_webhook = {
description = "Cluster API to node 9443/tcp webhook"
from_port = 9443
protocol = "tcp"
source_cluster_security_group = true
to_port = 9443
type = "ingress"
}
}
}
3 changes: 3 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ resource "aws_ec2_tag" "container_subnets" {
}
}

# NOTE: Because the source SG of this rule is the primary SG of the cluster,
# we cannot add it to "node_security_group_additional_rules" map, which is
# referenced by cluster module. It will create circular dependency.
resource "aws_security_group_rule" "allow_sidecar_injection" {
description = "Webhook container port, from Control Plane"
protocol = "tcp"
Expand Down
57 changes: 0 additions & 57 deletions sg_ports.tf

This file was deleted.