This lab demonstrates the use of Terraform to provision and manage infrastructure as code.
It includes configuration files for defining variables, resources, and state management.
Before starting this lab, make sure you have the following tools installed and configured on your system:
-
Terraform — used for Infrastructure as Code (IaC)
▶️ Installation guide (YouTube): How to Install Terraform -
Git — used for version control
▶️ Configuration guide (YouTube): Git Configuration Tutorial -
AWS CLI — used for managing AWS services via the command line
▶️ Installation guide (YouTube): AWS CLI Setup Tutorial
Use Visual Studio Code (VS Code) as your IDE for this lab.
It provides syntax highlighting, linting, and Terraform integration for a smoother workflow.
Before starting the lab, each student should fork this repository into their own GitHub account and then clone it locally.
🧩 Steps to Fork the Repository
-
Go to the main course repository on GitHub (provided by the instructor).
-
Click the “Fork” button in the top-right corner to create a personal copy of the repository under your GitHub account.
-
Once forked, open your forked repository and click “Code” → “Copy HTTPS URL”.
💻 Clone the Repository to Your Local Machine
Run the following commands in your terminal or VS Code:
Navigate to the directory where you want to store the project
cd ~/your-directoryClone your forked repository (replace with your GitHub username)
git clone https://github.com/<your-github-username>/cemeweLab1.gitMove into the project directory
cd cemeweLab1If this is your first time using Git on your system, set your username and email:
git config --global user.name "Username"
git config --global user.email "email@example.com"You can verify your configuration using:
git config --listIf you want to use different identities for specific projects (for example, one for personal projects and one for work), you can configure Git only for the current repository.
git config user.name "Username"
git config user.email "email@example.com"Before running Terraform commands, open the variables.tf file and update the following variable:
variable "student_name" {
description = "Unique student identifier"
type = string
default = "test_student1" # <-- Each student updates this value
}Run this command to download providers and initialize the working directory:
terraform initCheck that your .tf files are syntactically and structurally correct.
terraform validateSee what Terraform will do before actually applying any changes.
terraform planProvision your infrastructure as defined in the .tf files.
terraform apply