Learn how infrastructure as code lets you safely build, change, and manage infrastructure. Try 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.
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.
Add tags to an existing Azure resource group to learn how Terraform manages infrastructure changes. Edit Terraform configuration, then plan and apply the change.
Destroy Azure infrastructure managed by Terraform. Evaluate the plan and confirm the destruction.
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.
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.
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.