-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathvpc.tf
127 lines (116 loc) · 2.42 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
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
resource "aws_vpc" "" {
cidr_block = ""
enable_dns_hostnames = true
enable_dns_support = true
instance_tenancy = "default"
enable_classiclink_dns_support = true
tags = {
Name = ""
}
}
resource "aws_internet_gateway" "us-west-2-igw" {
vpc_id = "${aws_vpc.us-west-2-vpc-main.id}"
}
resource "aws_security_group" "dn-sg-usw2-apiservers" {
name = "dn-sg-usw2-apiservers"
description = "api server ports"
vpc_id = "${aws_vpc.us-west-2-vpc-main.id}"
ingress {
from_port = 80
to_port = 80
protocol = "tcp"
security_groups = ["sg-015d95f6088e7413c"]
description = "http traffic"
}
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
description = "SSH"
}
ingress {
security_groups = ["sg-015d95f6088e7413c"]
from_port = 443
to_port = 443
protocol = "tcp"
description = "https traffic"
}
ingress {
from_port = 9100
to_port = 9101
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
description = "Metrics Export"
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
egress {
from_port = 6379
to_port = 6379
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
description = "API Servers Connection"
}
tags = {
Name = "dn-sg-usw2-apiservers"
}
}
resource "aws_security_group" "" {
name = ""
description = ""
vpc_id = ""
ingress {
from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
description = "http traffic"
}
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
description = "SSH"
}
ingress {
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
description = "https traffic"
}
egress {
from_port = 80
to_port = 80
protocol = "tcp"
description = "HTTP traffic"
security_groups = [""]
}
egress {
from_port = 443
to_port = 443
protocol = "tcp"
description = "HTTPS traffic"
security_groups = ["${aws_security_group.dn-sg-usw2-apiservers.id}"]
# security_groups = "${aws_security_group.dn-sg-usw2-apiservers.id}"
}
tags = {
Name = ""
}
}
# AWS Subnet Section
resource "aws_subnet" "" {
vpc_id = ""
cidr_block = ""
availability_zone = ""
map_public_ip_on_launch = true
tags = {
Name = ""
}
}