forked from azeezsalu/terraform-tutorial-reference-files
-
Notifications
You must be signed in to change notification settings - Fork 1
/
security-group reference.tf
67 lines (58 loc) · 1.3 KB
/
security-group reference.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
# create security group for the application load balancer
resource "aws_security_group" "alb_security_group" {
name = "alb security group"
description = "enable http/https access on port 80/443"
vpc_id =
ingress {
description = "http access"
from_port =
to_port =
protocol =
cidr_blocks =
}
ingress {
description = "https access"
from_port =
to_port =
protocol =
cidr_blocks =
}
egress {
from_port =
to_port =
protocol =
cidr_blocks =
}
tags = {
Name =
}
}
# create security group for the container
resource "aws_security_group" "ecs_security_group" {
name = "ecs security group"
description = "enable http/https access on port 80/443 via alb sg"
vpc_id =
ingress {
description = "http access"
from_port =
to_port =
protocol =
security_groups =
}
ingress {
description = "https access"
from_port =
to_port =
protocol =
security_groups =
}
egress {
from_port =
to_port =
protocol =
cidr_blocks =
}
tags = {
Name =
}
}