-
Notifications
You must be signed in to change notification settings - Fork 1
/
security_group.tf
44 lines (36 loc) · 1.23 KB
/
security_group.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
resource "aws_security_group_rule" "humans_to_alb_https" {
type = "ingress"
from_port = 443
to_port = 443
protocol = "tcp"
description = "Allowed human acces on ALB"
cidr_blocks = var.allow_cidr_blocks
security_group_id = module.alb.security_group_id
}
resource "aws_security_group_rule" "humans_to_alb_9090_9200" {
type = "ingress"
from_port = 9090
to_port = 9200
protocol = "tcp"
description = "Allowed human acces on ALB"
cidr_blocks = var.allow_cidr_blocks
security_group_id = module.alb.security_group_id
}
resource "aws_security_group_rule" "humans_to_alb_8080" {
type = "ingress"
from_port = 8080
to_port = 8080
protocol = "tcp"
description = "Allowed human acces on ALB"
cidr_blocks = var.allow_cidr_blocks
security_group_id = module.alb.security_group_id
}
resource "aws_security_group_rule" "natgateway_to_alb_9090_9200" {
type = "ingress"
from_port = 9090
to_port = 9200
protocol = "tcp"
description = "Allowed IP outbound nat to reach ALB"
cidr_blocks = formatlist("%s/32", data.terraform_remote_state.infra-stack.outputs.natgateway_public_ip)
security_group_id = module.alb.security_group_id
}