Terraform uses the definitions in the maint.tf file to create resources in Azure. It determines in what order resources need to be created. And, it tracks your resources for you, so you can change them in the main.tf file at any time without starting from scratch.

This page describes how to review your Terraform plan and deploy your resources.

Run the Terraform command

  1. In your terminal, run the following command:

     terraform plan
    

    This command tells you how Terraform will build your infrastructure. It tallies up how many resources your Terraform code will add, change, or destroy.

    terraform-plan
    terraform plan output

    Always review the plan before you create or edit resources. This is your chance to catch any misconfigurations that might harm or accidentally delete your resources.

  2. After you review the plan, run the following command:

     terraform apply
    

    The command asks you to confirm. To do so, enter yes.

    terraform-apply-confirm
    terraform apply confirmation message

    This creates your infrastructure. This may take a few minutes.

The results are displayed in your terminal.

terraform-apply-complete
terraform apply completion message

Your resources are ready to use in Azure. See your new resource group in the Azure portal.

azure-resources
Azure resource group details

Learn more

Updated: