-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsg.tf
43 lines (38 loc) · 857 Bytes
/
sg.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
resource "aws_security_group" "sg" {
name = "SG-${var.projectName}"
description = var.projectName
vpc_id = var.vpcId
ingress {
description = "Sonar"
from_port = 9000
to_port = 9000
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
egress {
description = "All"
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}
resource "aws_security_group" "sg-rds" {
name = "SG-${var.projectName}-rds"
description = var.projectName
vpc_id = var.vpcId
ingress {
description = "VPC"
from_port = 5432
to_port = 5432
protocol = "tcp"
cidr_blocks = ["${var.vpcCIDR}"]
}
egress {
description = "VPC"
from_port = 5432
to_port = 5432
protocol = "tcp"
cidr_blocks = ["${var.vpcCIDR}"]
}
}