This Project create VPC and 2 instance 1 is web-database and 2nd is database
-
VPC with cidr block 10.0.0.0/16 ( class A network)
-
Creat a subnet a) public-subnet : 10.0.0.0/24 b) private-subnet : 10.0.1.0/24
3)Public ip's for for nat and public-instance
-
Create a internet gateway
-
Create Nat Gateway for database subnet (it will allow internet and stop internet to directrly associate to database )
-
Creating public and private route table for both subnet and igw
-
associate the 2 subnet to each route table
-
Create Scurity grp for vpc
-
Create A key pair for both instance for connecting via ssh
-
Create A web instance in public subnet and database instance in private subnet
Note : For some how our database instance is not able to connect internet i am try to reslove this issue in futhure till you can use this single terraform script to create above infra in 1 go.