Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions terraform/aws/infrastructure.tf
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
resource "aws_vpc" "main" {
tags = {
Name = "main"
}
cidr_block = var.vpc_cidr
enable_dns_hostnames = "true"
tags = {
Name = "main"
}
cidr_block = var.vpc_cidr
enable_dns_hostnames = "true"
}

/* Internet gateway for the public subnet */
resource "aws_internet_gateway" "gateway" {
vpc_id = aws_vpc.main.id
tags = {
Name = "main-gw"
}
vpc_id = aws_vpc.main.id
tags = {
Name = "main-gw"
}
}

resource "aws_subnet" "public" {
vpc_id = aws_vpc.main.id
cidr_block = var.vpc_public_subnet
map_public_ip_on_launch = "true"
depends_on = [aws_internet_gateway.gateway]
tags = {
Name = "Public Subnet"
}
vpc_id = aws_vpc.main.id
cidr_block = var.vpc_public_subnet
map_public_ip_on_launch = false
depends_on = [aws_internet_gateway.gateway]
tags = {
Name = "Public Subnet"
}
}

resource "aws_subnet" "private" {
vpc_id = aws_vpc.main.id
cidr_block = var.vpc_private_subnet
map_public_ip_on_launch = false
tags = {
Name = "Private Subnet"
}
vpc_id = aws_vpc.main.id
cidr_block = var.vpc_private_subnet
map_public_ip_on_launch = false
tags = {
Name = "Private Subnet"
}
}