-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsecurity_groups.tf
More file actions
58 lines (45 loc) · 1.35 KB
/
security_groups.tf
File metadata and controls
58 lines (45 loc) · 1.35 KB
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
##################################################################################
# RESOURCES
##################################################################################
resource "aws_security_group" "webapp_http_inbound_sg" {
name = "${local.name_prefix}-http-inbound"
description = "Allow HTTP from Anywhere"
ingress {
from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
vpc_id = data.tfe_outputs.networking.nonsensitive_values.vpc_id
tags = local.common_tags
}
resource "aws_security_group" "webapp_ssh_inbound_sg" {
name = "${local.name_prefix}-ssh-inbound"
description = "Allow SSH from certain ranges"
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = [var.ip_range]
}
vpc_id = data.tfe_outputs.networking.nonsensitive_values.vpc_id
tags = local.common_tags
}
resource "aws_security_group" "webapp_outbound_sg" {
name = "${local.name_prefix}-webapp-outbound"
description = "Allow outbound connections"
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
vpc_id = data.tfe_outputs.networking.nonsensitive_values.vpc_id
tags = local.common_tags
}