This repository has been archived by the owner on Nov 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsecurity_groups.tf
135 lines (109 loc) · 3.26 KB
/
security_groups.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
module lb_sg {
source = "terraform-aws-modules/security-group/aws"
name = "${local.cname}_lb"
vpc_id = data.aws_vpc.this.id
description = "Managed by Terraform"
tags = {
Name = "${local.cname}_lb"
Description = "Managed by Terraform"
}
ingress_cidr_blocks = local.cidrs.allowed
ingress_rules = ["https-443-tcp", "all-icmp"]
ingress_with_cidr_blocks = [
{
from_port = 9999
to_port = 9999
protocol = "tcp"
cidr_blocks = join(",", local.cidrs.admin_allowed)
},
]
egress_cidr_blocks = ["0.0.0.0/0"]
egress_rules = ["all-all"]
}
module app_sg {
source = "terraform-aws-modules/security-group/aws"
name = local.cname
vpc_id = data.aws_vpc.this.id
description = "Managed by Terraform"
tags = {
Name = local.cname
Description = "Managed by Terraform"
}
ingress_cidr_blocks = ["0.0.0.0/0"]
ingress_rules = ["all-icmp"]
egress_cidr_blocks = ["0.0.0.0/0"]
egress_rules = ["all-all"]
computed_ingress_with_source_security_group_id = [
{
rule = "all-all"
source_security_group_id = module.lb_sg.security_group_id
},
{
from_port = 7600
to_port = 7600
protocol = "tcp"
source_security_group_id = module.admin_sg.security_group_id
},
]
number_of_computed_ingress_with_source_security_group_id = 2
}
module admin_sg {
source = "terraform-aws-modules/security-group/aws"
name = "${local.cname}_admin"
vpc_id = data.aws_vpc.this.id
description = "Managed by Terraform"
tags = {
Name = "${local.cname}_admin"
Description = "Managed by Terraform"
}
ingress_cidr_blocks = ["0.0.0.0/0"]
ingress_rules = ["all-icmp"]
egress_cidr_blocks = ["0.0.0.0/0"]
egress_rules = ["all-all"]
ingress_with_cidr_blocks = [
{
from_port = 9999
to_port = 9999
protocol = "tcp"
cidr_blocks = join(",", local.cidrs.admin_allowed)
},
]
computed_ingress_with_source_security_group_id = [
{
rule = "all-all"
source_security_group_id = module.lb_sg.security_group_id
},
{
from_port = 7600
to_port = 7600
protocol = "tcp"
source_security_group_id = module.app_sg.security_group_id
},
]
number_of_computed_ingress_with_source_security_group_id = 2
}
module efs_sg {
source = "terraform-aws-modules/security-group/aws"
name = "${local.cname}_efs"
vpc_id = data.aws_vpc.this.id
description = "Managed by Terraform"
tags = {
Name = "${local.cname}_efs"
Description = "Managed by Terraform"
}
ingress_cidr_blocks = ["0.0.0.0/0"]
ingress_rules = ["all-icmp"]
egress_cidr_blocks = ["0.0.0.0/0"]
egress_rules = ["all-all"]
computed_ingress_with_source_security_group_id = [
{
rule = "nfs-tcp"
source_security_group_id = module.app_sg.security_group_id
},
{
rule = "nfs-tcp"
source_security_group_id = module.admin_sg.security_group_id
},
]
number_of_computed_ingress_with_source_security_group_id = 2
}