Skip to content

Commit

Permalink
vpc.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahim-mohamed-zaghloul committed Jul 18, 2024
1 parent 68e000a commit dec7d55
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions terraform/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,21 @@ resource "aws_route_table_association" "rt-association" {

resource "aws_security_group" "security-group" {
vpc_id = aws_vpc.vpc.id
description = "Allowing Jenkins, Sonarqube, SSH Access"

ingress = [
for port in [22, 8080, 9000, 9090, 80] : {
description = "TLS from VPC"
from_port = port
to_port = port
protocol = "tcp"
ipv6_cidr_blocks = ["::/0"]
self = false
prefix_list_ids = []
security_groups = []
cidr_blocks = ["0.0.0.0/0"]
}
]
description = "Allowing SSH Access"

ingress {
from_port = 22 #SSH
to_port = 22
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 = var.sg-name
}
Expand Down

0 comments on commit dec7d55

Please sign in to comment.