Skip to content

Instantly share code, notes, and snippets.

@mlabouardy
Created October 27, 2017 19:00
Show Gist options
  • Save mlabouardy/053c180abeda2547c56bd773ff6b3d6d to your computer and use it in GitHub Desktop.
Save mlabouardy/053c180abeda2547c56bd773ff6b3d6d to your computer and use it in GitHub Desktop.
Define 2 Subnets in VPC
# Define the public subnet
resource "aws_subnet" "public-subnet" {
vpc_id = "${aws_vpc.default.id}"
cidr_block = "${var.public_subnet_cidr}"
availability_zone = "us-east-1a"
tags {
Name = "Web Public Subnet"
}
}
# Define the private subnet
resource "aws_subnet" "private-subnet" {
vpc_id = "${aws_vpc.default.id}"
cidr_block = "${var.private_subnet_cidr}"
availability_zone = "us-east-1b"
tags {
Name = "Database Private Subnet"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment