github.com/swisspost/terratest@v0.0.0-20230214120104-7ec6de2e1ae0/examples/azure/terraform-azure-disk-example/README.md (about)

     1  # Terraform Azure Disk Example
     2  
     3  This folder contains a simple Terraform module that deploys resources in [Azure](https://azure.microsoft.com/) to demonstrate
     4  how you can use Terratest to write automated tests for your Azure Terraform code. This module deploys an [Azure managed disk](https://azure.microsoft.com/services/storage/disks).
     5  
     6  Check out [test/azure/terraform_azure_disk_example_test.go](/test/azure/terraform_azure_disk_example_test.go) to see how you can write automated tests for this module.
     7  
     8  Note that the resources deployed in this module don't actually do anything; it just runs the resources for demonstration purposes.
     9  
    10  **WARNING**: This module and the automated tests for it deploy real resources into your Azure account which can cost you money. The resources are all part of the [Azure Free Account](https://azure.microsoft.com/free/), so if you haven't used that up, it should be free, but you are completely responsible for all Azure charges.
    11  
    12  ## Running this module manually
    13  
    14  1. Sign up for [Azure](https://azure.microsoft.com/)
    15  1. Configure your Azure credentials using one of the [supported methods for Azure CLI
    16     tools](https://docs.microsoft.com/cli/azure/azure-cli-configuration?view=azure-cli-latest)
    17  1. Install [Terraform](https://www.terraform.io/) and make sure it's on your `PATH`
    18  1. Ensure [environment variables](../README.md#review-environment-variables) are available
    19  1. Run `terraform init`
    20  1. Run `terraform apply`
    21  1. When you're done, run `terraform destroy`
    22  
    23  ## Running automated tests against this module
    24  
    25  1. Sign up for [Azure](https://azure.microsoft.com/).
    26  2. Configure your Azure credentials using one of the [supported methods for Azure CLI tools](https://docs.microsoft.com/cli/azure/azure-cli-configuration?view=azure-cli-latest).
    27  
    28  3. Install [Terraform](https://www.terraform.io/) and make sure it's on your `PATH`.
    29  4. [Review environment variables](#review-environment-variables).
    30  5. Install [Golang](https://golang.org/) and make sure this code is checked out into your `GOPATH`.
    31  6. `cd test`
    32  7. Make sure [the azure-sdk-for-go versions match](#check-go-dependencies) in [/test/go.mod](/test/go.mod) and in [test/azure/terraform_azure_disk_example_test.go](/test/azure/terraform_azure_disk_example_test.go).
    33  8. `go test -v -run TestTerraformAzureDiskExample`