-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvpc.tf
60 lines (50 loc) · 1.16 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
resource "aws_vpc" "dev" {
cidr_block = "10.0.0.0/16"
instance_tenancy = "default"
enable_dns_hostnames = true
tags = merge(
var.common_tags,
{
Name = "vpc-${var.name}"
}
)
}
resource "aws_subnet" "publicA" {
vpc_id = aws_vpc.dev.id
cidr_block = "10.0.0.0/24"
availability_zone = "us-east-1a"
map_public_ip_on_launch = true
tags = merge(
var.common_tags,
{
Name = "subnet-${var.name}-publicA"
}
)
depends_on = [aws_vpc.dev]
}
resource "aws_subnet" "privateA" {
vpc_id = aws_vpc.dev.id
cidr_block = "10.0.16.0/20"
availability_zone = "us-east-1a"
map_public_ip_on_launch = false
tags = merge(
var.common_tags,
{
Name = "subnet-${var.name}-privateA"
}
)
depends_on = [aws_vpc.dev]
}
resource "aws_subnet" "privateB" {
vpc_id = aws_vpc.dev.id
cidr_block = "10.0.32.0/20"
availability_zone = "us-east-1b"
map_public_ip_on_launch = false
tags = merge(
var.common_tags,
{
Name = "subnet-${var.name}-privateB"
}
)
depends_on = [aws_vpc.dev]
}