ToolJet/terraform/AMI_EC2/sg.tf
2025-09-19 01:12:30 +05:30

27 lines
No EOL
570 B
HCL

# Define the security group
resource "aws_security_group" "tooljet_sg" {
vpc_id = aws_vpc.tooljet_vpc.id
name = "tooljet-sg"
description = "Allow SSH, HTTP, HTTPS and ToolJet ports"
dynamic "ingress" {
for_each = var.ingress_ports
content {
from_port = ingress.value
to_port = ingress.value
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
tags = {
Name = "TooljetSecurityGroup"
}
}