In this article we will imagine that you were assigned to develop a non-production environment that provides logical network isolation to test a group of resources, such a fleet of AWS Elastic Compute Cloud (EC2) instances that will be hosting web applications.
Following the scenario, the Cloud Solutions Architect team provided you with the diagram below to be used as a reference. The main goal for this infrastructure is to build it as a code (IaaC) using Terraform.
Diagram 1: VPC.
"Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions.” The official Terraform documentation
The official Terraform documentation
Terraform is a powerful declarative tool that helps us to manage a vast majority of cloud services as well as provides consistency and visibility of infrastructure changes happening across different workspace and environments. This functionality not only serves as an important improvement to the quality of the project lifecycle but also keeps software engineers and others on the same team informed.
Please note that we can create or configure any AWS server through the AWS management console, but the problem is that it takes time if you do the same thing again and again. By using Terraform, we don't need to sign in on the AWS management console and can finish our work with the command-line alone.
In this project you will encounter one module. This module will help you to deploy one or multiple VPCs in one go.
Terraform templates previous
Now that you have your Terraform templates ready let's describe each networking component briefly
What is a VPC?
What is an EC2?
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers." The official AWS documentation
The official AWS documentation
What is an Internet gateway?
What is a Subnet?
What is a Security group?
"A security group acts as a virtual firewall for your instance to control inbound and outbound traffic. When you launch an instance in a VPC, you can assign up to five security groups to the instance." The official AWS documentation
The official AWS documentation
Another important note is that this infrastructure can be more robust by adding other servers such as AWS Auto Scaling Groups, AWS ELB's, AWS Natgateway, or Network Access Control List (NACL's) which I will probably be adding in a later article 😊.
Having Terraform in the mix facilitates the creation, destruction of resources, testing and debugging of your projects.
This Terraform project is dynamically designed to deploy the following services and associations:
Functions, arguments and expressions of Terraform that were used in the above project:
I would like to give a big shout out to my mentor Derek Morgan. Thank you for all of your support all these months and for the amazing course "More Than Certified in Terraform" the best course out there. Link to the course here. If you want to connect with him and ask questions about his course, contact him via LinkedIn Derek Morgan or you can join the TechStudySlack channel here.