-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path9-sg-data-layer.tf
53 lines (41 loc) · 1.73 KB
/
9-sg-data-layer.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
44
45
46
47
48
49
50
51
52
53
# security group for alb, to allow acess from any where for HTTP and HTTPS traffic
resource "aws_security_group" "datalayer-sg" {
name = format("%s%s%s", title(var.env), title(var.base_name), "-Datalayer-SG")
vpc_id = module.network_module.vpc_id
description = "Datalayer SG"
tags = {
Name = format("%s%s%s", title(var.env), title(var.base_name), "-Datalayer-SG")
}
}
resource "aws_security_group_rule" "allow_from_tooling_web_to_mysql" {
type = "ingress"
from_port = 3306
to_port = 3306
protocol = "tcp"
source_security_group_id = aws_security_group.wordpress-sg.id
security_group_id = aws_security_group.datalayer-sg.id
}
resource "aws_security_group_rule" "allow_from_wordpress_web_to_mysql" {
type = "ingress"
from_port = 3306
to_port = 3306
protocol = "tcp"
source_security_group_id = aws_security_group.tooling-sg.id
security_group_id = aws_security_group.datalayer-sg.id
}
resource "aws_security_group_rule" "allow_from_tooling_web_to_efs" {
type = "ingress"
from_port = 2049
to_port = 2049
protocol = "tcp"
source_security_group_id = aws_security_group.wordpress-sg.id
security_group_id = aws_security_group.datalayer-sg.id
}
resource "aws_security_group_rule" "allow_from_wordpress_web_to_efs" {
type = "ingress"
from_port = 2049
to_port = 2049
protocol = "tcp"
source_security_group_id = aws_security_group.tooling-sg.id
security_group_id = aws_security_group.datalayer-sg.id
}