-
Notifications
You must be signed in to change notification settings - Fork 0
/
rednet.tf
68 lines (57 loc) · 1.51 KB
/
rednet.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
resource "aws_subnet" "red_subnet" {
vpc_id = aws_vpc.range.id
cidr_block = "10.0.30.0/24"
availability_zone = var.aws_availability_zone
}
resource "aws_route_table" "red_routes" {
vpc_id = aws_vpc.range.id
route {
cidr_block = "0.0.0.0/0"
nat_gateway_id = aws_nat_gateway.bastion_nat_gateway.id
}
}
resource "aws_route_table_association" "red_routes" {
subnet_id = aws_subnet.red_subnet.id
route_table_id = aws_route_table.red_routes.id
}
resource "aws_network_acl" "red_subnet_acl" {
vpc_id = aws_vpc.range.id
subnet_ids = [aws_subnet.red_subnet.id]
ingress {
action = "allow"
cidr_block = "0.0.0.0/0"
from_port = 0
to_port = 0
protocol = "-1"
rule_no = 100
}
egress {
action = "allow"
cidr_block = "0.0.0.0/0"
from_port = 0
to_port = 0
protocol = "-1"
rule_no = 100
}
}
resource "aws_network_interface" "kalione_nic" {
subnet_id = aws_subnet.red_subnet.id
private_ips = ["10.0.30.10"]
security_groups = [aws_security_group.range_default_sg.id]
tags = {
Name = "range_kalione"
}
}
resource "aws_instance" "kalione" {
ami = data.aws_ami.kali.id
instance_type = "t2.micro"
availability_zone = var.aws_availability_zone
key_name = aws_key_pair.range_ssh_public_key.key_name
network_interface {
network_interface_id = aws_network_interface.kalione_nic.id
device_index = 0
}
tags = {
"Name" = "Kali One"
}
}