- Lab
- A Cloud Guru
Migrate Terraform State to Terraform Cloud for Azure
In this hands-on lab, you will learn how to import Azure resources into Terraform state, view objects in Terraform state, and migrate your state to Terraform Cloud. **Note:** To complete this lab, you will need your own free Terraform Cloud account. You can sign up for a free account at [Terraform Cloud](https://app.terraform.io/public/signup).
Path Info
Table of Contents
-
Challenge
Import Existing Resources into Terraform State
- Open the existing Terraform configuration file in
C:\MigrateState
. - Initialize the working directory.
- Log in to Azure using the Azure CLI.
- Import the exsting resource group into your local state.
- Open the existing Terraform configuration file in
-
Challenge
Inspect the Local State File
Verify the resource group has been imported into the state file using the Terraform CLI.
-
Challenge
Configure a Terraform Cloud Workspace
- Create a Terraform Cloud Workspace.
- Update the
main.tf
file with the cloud configuration block.
-
Challenge
Migrate State to Terraform Cloud
Initialize the working directory and migrate the state file to Terraform Cloud.
-
Challenge
Delete the Local State File
Delete the local state file and the state file backup.
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.