Build, change, and destroy Azure infrastructure using Terraform. Step-by-step, command-line tutorials will walk you through the Terraform basics for the first time.
Learn how infrastructure as code lets you safely build, change, and manage infrastructure. Try Terraform.
9min
Install Terraform
Install Terraform on Mac, Linux, or Windows by downloading the binary or using a package manager (Homebrew or Chocolatey). Then create a Docker container locally by following a quick-start tutorial to check that Terraform installed correctly.
10min
Build Infrastructure - Terraform Azure Example
Initialize, plan and apply configuration in a directory to create an Azure resource group. Inspect the Terraform state to discover the group ID once Terraform creates it.
4min
Change Infrastructure
Add tags to an existing Azure resource group to learn how Terraform manages infrastructure changes. Edit Terraform configuration, then plan and apply the change.
3min
Destroy Infrastructure
Destroy Azure infrastructure managed by Terraform. Evaluate the plan and confirm the destruction.
4min
Define Input Variables
Declare your Azure resource group name as a variable. Reference the variable in Terraform configuration. Define a variable using command line flags or default values.
2min
Query Data with Output Variables
Output the ID of an Azure resource group using output variables. Read about using outputs to query specific data from Terraform state.
8min
Store Remote State
Configure Terraform to store state in Terraform Cloud. Add a remote state block directly to configuration or set an environment variable to load remote state configuration when Terraform initializes.