-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.tf
78 lines (65 loc) · 1.58 KB
/
main.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
# https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws/
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "5.5.1"
name = "black-team"
cidr = "172.16.0.0/16"
secondary_cidr_blocks = ["172.20.0.0/16"]
azs = ["us-east-2a"]
public_subnets = ["172.16.0.0/16"]
private_subnets = ["172.20.0.0/17"]
enable_dns_hostnames = true
enable_dns_support = true
enable_nat_gateway = true
single_nat_gateway = true
one_nat_gateway_per_az = false
vpc_tags = {
competition = "regionals"
}
nat_gateway_tags = {
Name = "black-team"
}
}
resource "aws_security_group" "packer" {
name = "packer"
description = "Allow packer to configure hosts"
vpc_id = module.vpc.vpc_id
ingress {
description = "Allow SSH"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
description = "More SSH for K8s"
from_port = 2222
to_port = 2222
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
description = "Allow WinRM HTTP/HTTPS"
from_port = 5985
to_port = 5986
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
description = "Internal Traffic"
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["172.16.0.0/16"]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}
tags = {
Name = "packer"
}
}