Ticket Type: Task
Title: Terraform TFVars with AWS VPC
Project: Cloud Infrastructure Deployment
Assignee: You
Reporter: Derek Morgan
Priority: High
Labels: Terraform, AWS, Variables, TFVars, VPC
Epic Link: AWS Infrastructure Expansion
Sprint: Sprint 01/Tfvars
Lab Setup
This lab uses Localstack to simulate an AWS environment. Localstack is already preinstalled in your environment. You don't need keys or to configure the provider. If you'd like to use your own account, feel free to specify your provider configuration and run unset aws
and unset terraform
to decouple them from Localstack.
Description:
Your team needs to set up Virtual Private Clouds (VPCs) in AWS for different environments. These VPCs need to be configured in such a way that all their attributes are modular and their values are stored in a variables.tf
file. These variable definitions need to be added to variable definitions files in order to deploy environments with different attributes dynamically.
Acceptance Criteria:
Note: If the
terraform validate
command fails, all tasks in the lab will fail!
- Create two files that define variables needed to deploy a
development
and aproduction
VPC environment. - The variables needed are:
project
- The project name for the VPCenv
- The environment (dev or prod)enable_dns_hostnames
- Whether DNS hostnames are enabledcidr_block
- The CIDR block for the VPC
- Within the two files, create values for these variables that make sense for each environment (e.g., smaller CIDR for dev, larger for prod).
Implementation Notes:
Feel free to use code from previous labs. The values aren't as important as the concepts.