hands-on lab
Git Based Terraform Template Management
Difficulty: Beginner
Duration: Up to 1 hour
Students: 376
Rating: 4.7/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.
Description
Terraform, a popular IaC (Infrastructure as Code) tool, can be used to provision infrastructure safely and efficiently. When working with Terraform, your resources are codified into Terraform templates, which then should be version-controlled within a source control system such as Git.
In this Lab scenario, you'll learn how to use both Terraform and Git to manage and maintain resources launched within AWS.
Learning Objectives
Upon completion of this Lab, you will be able to:
- Use Git (GUI and Commandline) to
- Clone a sample repository containing a Terraform template
- View and examine differences made to the working copy of the Terraform template
- Stage changes into Staging
- Create a new commit within the local repository
- Push the local repository changes back to the origin repository
- View repository logs (local and remote/origin)
- Use Terraform to:
- Update an existing Terraform template to provision a single EC2 instance
- Initialize a working directory (terraform init)
- Create an execution plan (terraform plan)
- Apply changes to reach the desired state of the configuration (terraform apply)
You should:
- Be comfortable with basic Linux command line administration
Lab Environment
This lab will start with the following AWS resources provisioned automatically for you:
- 1 x EC2 instance
- ide.cloudacademy.platform.instance - provides a web-based IDE with integrated terminal
To achieve the lab end state, you will be walked through the process of:
- Using your local workstation browser to remotely connect to the ide.cloudacademy.platform.instance
- Using the web-based IDE and integrated terminal, you'll complete the remainder of the stated Learning Objectives (above)
Covered topics
Lab steps
Logging In to the Amazon Web Services Console
Launch the Web IDE
Git Clone Terraform Repo
Perform Terraforming
Git Commit and Push Updates