AWS Task 4

  Task Description





Perform task-3 with an additional feature to be added that is NAT Gateway to provide the internet access to instances running in the private subnet.

 

Performing the following steps:

1.  Write an Infrastructure as code using terraform, which automatically create a VPC.

2.  In that VPC we have to create 2 subnets:

    1.   public  subnet [ Accessible for Public World! ] 

    2.   private subnet [ Restricted for Public World! ]

3. Create a public facing internet gateway for connect our VPC/Network to the internet world and attach this gateway to our VPC.

4. Create  a routing table for Internet gateway so that instance can connect to outside world, update and associate it with public subnet.

5.  Create a NAT gateway for connect our VPC/Network to the internet world  and attach this gateway to our VPC in the public network

6.  Update the routing table of the private subnet, so that to access the internet it uses the nat gateway created in the public subnet

7.  Launch an ec2 instance which has Wordpress setup already having the security group allowing  port 80 sothat our client can connect to our wordpress site. Also attach the key to instance for further login into it.

8.  Launch an ec2 instance which has MYSQL setup already with security group allowing  port 3306 in private subnet so that our wordpress vm can connect with the same. Also attach the key with the same.

 

Note: Wordpress instance has to be part of public subnet so that our client can connect our site. 

mysql instance has to be part of private  subnet so that outside world can't connect to it.






Instance launch by terraform

We launch our instance with the help of terraform code.
   








terraform validate

We apply terraform so that to validate our code of terraform.



VPC create

  We create a VPC in AWS...we will attach subnet public and private service with this VPC.



VPC validatre with terraform

we apply terraform to validate our VPC creation terraform code.










Subnet creation public and private

We create public and private subnet inside our VPC.







validate subnet with terraform

Now we apply terraform to validate our code to creation of Subnet in VPC.











Internet gateway

Here we create an internal gateway, so that our instances can access web.




Validation of code

We apply terraform to validate our code.




Route table

After this we create our route table(apply route table).






Code validate

Now we apply terraform to validate our code.















making Elastic Ip for permanent IP - 

If  we want our instance to be accessed by web we need a constant IP. We don't want our IP to change. SO we make an Elastic IP.



NAT gateway

We create a NAT gateway for our instance.





route table

After this we create our route table(apply route table).






Code Validate

We apply terraform for validating our code.




Security Group creation

After this we create security group for our instance. 




terraform validate

We apply terraform to validate our code.







AWS Instance launch

Now finally Instance AWS is launched with all the features we needed.



Net accessible in AWS instance

Here we can see that the internet is accessible in our instance.



Project Team:

                             1. Tushar Sharma

                              2. Vishal Kumar              







Comments