Project: Create a VPC with a CIDR Range
Test your knowledge by implementing a Terraform project that creates a VPC.
Problem statement#
Write a Terraform project that creates a VPC with a CIDR range set from a variable in a region set by another variable. Then apply the project and set the CIDR variable using a file and the region using an environment variable.
Files structure#
We can use the following files to implement the project:
Terraform project files used to implement the project
Running the project#
You can use the following commands to run the project:
Terraform init and apply commands used to run the project
📝Note: Clicking the RUN button will run the
terraform init
command.
Coding exercise#
Try to solve the above problem. If you can’t solve it, don’t give up. In the next lesson we will discuss the solution in detail.
Good Luck!
This code requires the following environment variables to execute:
access_key_id
Not Specified...
secret_access_key
Not Specified...
/
main.tf
variables.tf
terraform.tfvars
- main.tf
🎉Quiz
Solution Review: Create a VPC with a CIDR Range
Mark as Completed
Report an Issue