Terraform Series - Creating a VPC
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs2JabcJjYgd07RrU4cm9hPC2apOs3PnghP3l7XtPwgiWDDT9gjnacZ-L5qdjH8ubLXI35-54o8DLUhlaLolrDESOIEPvJBEXe00upIUmGdq79turLfkF6qJhxzZ8U7hD7FjgQ1rwkeM7GM9prg3NB_rpi1kwG0Y8tXAxWuE50XYLCKFkPlQNATEcq/s320/Screenshot%20Capture%20-%202023-01-04%20-%2022-26-28.png)
In this post we will see how to create a private subnet using Terraform. I am going to create 3 files. 1) VPC Variables file. 2) VPC Module file. 3) VPC Output file. VPC variable holds all the variables like vpc name, cidr, subnet and az details which are passed as a variables. # Creating variable for VPC Name - testvpc variable "vpc_name" { description = "VPC Name" type = string default = "testvpc" } # VPC CIDR variable "vpc_cidr" { type = string default = "10.0.0.0/16" } # VPC Availability Zone variable "vpc_az" { type = list ( string ) default = [ "us-east-1a" , "us-east-1b" ] } # VPC Private Subnet variable "vpc_private_subnets" { type = list ( string ) default = [ "10.0.1.0/24" , "10.0.2.0/24" ] } Next file contains the core VPC module file which uses the variable file to create a VPC. # Create VPC Terraform Module module ...