forked from veriskope/terraform-adobe-media-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vpc.tf
91 lines (79 loc) · 1.97 KB
/
vpc.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
resource "aws_internet_gateway" "default" {
vpc_id = "${aws_vpc.default.id}"
}
resource "aws_route" "default" {
route_table_id = "${aws_vpc.default.main_route_table_id}"
destination_cidr_block = "0.0.0.0/0"
gateway_id = "${aws_internet_gateway.default.id}"
}
resource "aws_security_group" "ams" {
name = "ams"
description = "Base security group for AMS instances"
vpc_id = "${aws_vpc.default.id}"
egress {
description = "allow egress to anywhere"
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
# allow SSH in from anywhere
ingress {
description = "allow SSH in from anywhere"
protocol = "tcp"
from_port = 22
to_port = 22
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
description = "allow HTTP in from anywhere"
protocol = "tcp"
from_port = 80
to_port = 80
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
description = "allow HTTPS in from anywhere"
protocol = "tcp"
from_port = 443
to_port = 443
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
description = "allow AMS Admin RTMP in from anywhere"
protocol = "tcp"
from_port = 1111
to_port = 1111
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
description = "allow RTMP streams in from anywhere"
protocol = "tcp"
from_port = 1935
to_port = 1935
cidr_blocks = ["0.0.0.0/0"]
}
# allow ICMP within VPC
ingress {
protocol = "icmp"
from_port = -1
to_port = -1
cidr_blocks = ["${aws_vpc.default.cidr_block}"]
}
egress {
protocol = "icmp"
from_port = -1
to_port = -1
cidr_blocks = ["${aws_vpc.default.cidr_block}"]
}
}
resource "aws_subnet" "ams_a" {
vpc_id = "${aws_vpc.default.id}"
cidr_block = "192.168.0.0/24"
availability_zone = "us-west-2a"
}
resource "aws_vpc" "default" {
cidr_block = "192.168.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
}