- Lab
- A Cloud Guru
Make Changes to Azure Infrastructure Using Terraform
Hey there, Gurus! Welcome to the lab! This lab will demonstrate how easy it is to manage and destroy infrastructure in Azure with Terraform. You, as an admin, are being asked to deploy a virtual network to Azure and then make some changes to the Azure infrastructure that has been deployed. You will then add a subnet to your test infrastructure and tags to the virtual network that specify the environment and team responsible for resource deployment. After testing the deployment, you will need to destroy all of the resources for the test infrastructure.
Path Info
Table of Contents
-
Challenge
Log In and Set Up the CLI
In the Portal
- Go to the portal and log in using your lab credentials.
- Open the CLI.
- Select Bash at the prompt.
- Click Show Advanced Settings.
- Set the Cloud Shell region to the same location as the resource group.
- Select the existing Resource Group, and select Use Existing for the Storage Account.
- In the File share section, choose Create new and enter "terraform".
- Click Attach Storage.
-
Challenge
Deploy the Infrastructure
In the CLI
- Download the lab-managing-azure.zip file from the lab's GitHub repo.
- Unzip the lab-managing-azure.zip file.
- Change to the lab-managing-azure working directory.
- Review the Terraform configuration file.
- Add the lab's Subscription ID and Azure Resource Group name to the configuration.
- Initialize the working directory.
- Apply the Terraform configuration.
-
Challenge
Add a Subnet to the Configuration
In the CLI
- Download the azure_resource_blocks.tf file from the lab's GitHub repo.
- Review the azure_resource_blocks.tf configuration file.
- Add the lab's Azure Resource Group name to the configuration.
- Apply the changes to your infrastructure.
- Confirm your changes.
-
Challenge
Add a Tag to the Configuration
In the CLI
- Edit the main.tf configuration file.
- Add the following code to the Virtual Network resource block:
# Create Tag tags = { Environment = "TheBatcave" Team = "Batman" }
- Check the formatting.
- Apply the changes to your infrastructure.
- Confirm your changes.
-
Challenge
Destroy the Infrastructure
In the CLI
- Delete your infrastructure using Terraform.
- Confirm your changes.
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
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.