-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvpc.tf
33 lines (30 loc) · 778 Bytes
/
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
# VPC
resource "aws_vpc" "project-dev-vpc" {
cidr_block = var.VPC_CIDR
enable_dns_support = "true"
enable_dns_hostnames = "true"
instance_tenancy = "default"
tags = {
Name = "${var.project}"
Env = "dev"
}
}
# subnets
resource "aws_subnet" "public-subnet" {
vpc_id = aws_vpc.project-dev-vpc.id
cidr_block = var.Public_Subnet_CIDR
map_public_ip_on_launch = "true"
availability_zone = "us-east-1a"
tags = {
Name = "public"
}
}
resource "aws_subnet" "private-subnet" {
vpc_id = aws_vpc.project-dev-vpc.id
cidr_block = var.Private_Subnet_CIDR
map_public_ip_on_launch = "false"
availability_zone = "us-east-1b"
tags = {
Name = "private"
}
}