Implement an AWS VPC Using Terraform
In this lab, you'll create a Virtual Private Network (VPC) in AWS, along with other AWS components, using Terraform. When you're finished with this lab, you'll have a good understanding of how to create AWS resources using Terraform.
Terms and conditions apply.
Lab info
Lab author
Challenge
Create a Working Environment
You will connect to an EC2 instance where you will run Terraform commands. You will also create an isolated Terraform project directory on the EC2 instance where your VPC Terraform project will reside.
Challenge
Initialize Backend and Provider Configurations
You will first create a Terraform backend configuration for your project, as well as an AWS Terraform provider configuration. You will also initialize the Terraform project directory to prepare for creating resources in the following challenges.
Challenge
Create a Terraform Execution Plan
You will use Terraform's planning ability to check whether the VPC execution plan matches the expectation, without making any real changes to the infrastructure.
Challenge
Apply a Terraform Execution Plan
You will create a basic VPC by applying a Terraform execution plan, and verifying its presence via AWS Console.
Challenge
Add a Tag to the VPC
You will add tags to better identify the VPC. You will also validate whether these tags have been correctly applied.
Challenge
Add Private and Public Subnets
You will expand the VPC by adding private and public subnets, along with route tables and an Internet Gateway. You will also plan and apply a large Terraform execution plan, and validate VPC components created.
Challenge
Write Dynamic Terraform Configuration
In this challenge, you will use availability zone data source to use attribute references for dynamic Terraform configuration. You will also learn how to create and use output values for the project.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.
Recommended prerequisites
- AWS VPC
- Basic networking concepts
- Linux shell CLI commands
- vim or nano