Skip to content

Instantly share code, notes, and snippets.

@khushi20218
Created August 10, 2020 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khushi20218/81061ff2cc9282ed1be869aa5cf10faf to your computer and use it in GitHub Desktop.
Save khushi20218/81061ff2cc9282ed1be869aa5cf10faf to your computer and use it in GitHub Desktop.
# public subnet
resource "aws_subnet" "pub_subnet1" {
vpc_id = aws_vpc.tf_vpc.id
availability_zone = "ap-south-1a"
cidr_block = "192.168.1.0/24"
map_public_ip_on_launch = true
tags= {
Name = "pub-subnet1"
}
}
# private subnet
resource "aws_subnet" "pvt_subnet2" {
vpc_id = aws_vpc.tf_vpc.id
availability_zone = "ap-south-1b"
cidr_block = "192.168.2.0/24"
map_public_ip_on_launch = false
tags= {
Name = "pvt-subnet2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment