-
Notifications
You must be signed in to change notification settings - Fork 1
/
vpc.tf
57 lines (49 loc) · 1.28 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
resource "aws_vpc" "splunk_vpc" {
cidr_block = "172.31.0.0/16"
enable_dns_support = "true"
enable_dns_hostnames = "true"
tags = merge(
local.common_tags,
{
"Name" = "splunk-vpc-${random_id.random.hex}"
}
)
}
resource "aws_internet_gateway" "splunk_gw" {
vpc_id = aws_vpc.splunk_vpc.id
tags = merge(
local.common_tags,
{
"Name" = "splunk-gw-${random_id.random.hex}"
}
)
}
resource "aws_route" "splunk_default_route" {
route_table_id = aws_vpc.splunk_vpc.main_route_table_id
destination_cidr_block = "0.0.0.0/0"
gateway_id = aws_internet_gateway.splunk_gw.id
}
resource "aws_subnet" "splunk_subnet_a" {
vpc_id = aws_vpc.splunk_vpc.id
cidr_block = "172.31.54.0/24"
map_public_ip_on_launch = true
availability_zone = "${var.aws_region}a"
tags = merge(
local.common_tags,
{
"Name" = "splunk-subnet-a-${random_id.random.hex}"
}
)
}
resource "aws_subnet" "splunk_subnet_b" {
vpc_id = aws_vpc.splunk_vpc.id
cidr_block = "172.31.55.0/24"
map_public_ip_on_launch = true
availability_zone = "${var.aws_region}b"
tags = merge(
local.common_tags,
{
"Name" = "splunk-subnet-b-${random_id.random.hex}"
}
)
}