Michael Bender 0e669e82ec updates
2023-05-16 21:33:19 -05:00

7.7 KiB


title: 'Quickstart: ' description: keywords: ms.topic: quickstart ms.date: ms.custom: devx-track-terraform author: ms.author:

Quickstart:

Article tested with the following Terraform and Terraform provider versions:

This article shows how to use Terraform to ...

[!INCLUDE Terraform abstract]

In this article, you learn how to:

[!div class="checklist"]

  • Task 1
  • Task 2
  • Task n

Note

The example code in this article is located in the Azure Terraform GitHub repo. See more articles and sample code showing how to use Terraform to manage Azure resources

Prerequisites

[!INCLUDE open-source-devops-prereqs-azure-subscription.md]

Implement the Terraform code

  1. Create a directory in which to test and run the sample Terraform code and make it the current directory.

  2. Create a file named providers.tf and insert the following code:

    [!code-terraform[master]()]

  3. Create a file named main.tf and insert the following code:

    [!code-terraform[master]()]

  4. Create a file named variables.tf and insert the following code:

    [!code-terraform[master]()]

  5. Create a file named outputs.tf and insert the following code:

    [!code-terraform[master]()]

  1. Create a file named and insert the following code:

    [!code-terraform[master]()]

Initialize Terraform

[!INCLUDE terraform-init.md]

Create a Terraform execution plan

[!INCLUDE terraform-plan.md]

Apply a Terraform execution plan

[!INCLUDE terraform-apply-plan.md]

Verify the results

Clean up resources

[!INCLUDE terraform-plan-destroy.md]

Troubleshoot Terraform on Azure

Troubleshoot common problems when using Terraform on Azure

Next steps

[!div class="nextstepaction"]