github.com/darmach/terratest@v0.34.8-0.20210517103231-80931f95e3ff/examples/azure/terraform-azure-availabilityset-example/README.md (about)

     1  # Terraform Azure Availability Set 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 Availability Set with one attched Virtual Machine.
     5  
     6  - An [Availability Set](https://docs.microsoft.com/en-us/azure/virtual-machines/availability) that gives the module the following:
     7    - `Availability Set` with the name specified in the `availability_set_name` output variable.
     8    - `Fault Domain Count` with the value specified in the `availability_set_fdc` output variable.
     9  - A [Virtual Machine](https://azure.microsoft.com/en-us/services/virtual-machines/) that gives the Availability Set the following:
    10    - [Virtual Machine](https://docs.microsoft.com/en-us/azure/virtual-machines/) with the name specified in the `vm_name` output variable.
    11  
    12  Check out [test/azure/terraform_azure_availabilityset_example_test.go](/test/azure/terraform_azure_availabilityset_example_test.go) to see how you can write
    13  automated tests for this module.
    14  
    15  Note that the Availability Set and VM in this module don't actually do anything; it just runs the resources for
    16  demonstration purposes.
    17  
    18  **WARNING**: This module and the automated tests for it deploy real resources into your Azure account which can cost you
    19  money. The resources are all part of the [Azure Free Account](https://azure.microsoft.com/en-us/free/), so if you haven't used that up,
    20  it should be free, but you are completely responsible for all Azure charges.
    21  
    22  ## Running this module manually
    23  
    24  1. Sign up for [Azure](https://azure.microsoft.com/)
    25  1. Configure your Azure credentials using one of the [supported methods for Azure CLI
    26     tools](https://docs.microsoft.com/en-us/cli/azure/azure-cli-configuration?view=azure-cli-latest)
    27  1. Install [Terraform](https://www.terraform.io/) and make sure it's on your `PATH`
    28  1. Ensure [environment variables](../README.md#review-environment-variables) are available
    29  1. Run `terraform init`
    30  1. Run `terraform apply`
    31  1. When you're done, run `terraform destroy`
    32  
    33  ## Running automated tests against this module
    34  
    35  1. Sign up for [Azure](https://azure.microsoft.com/)
    36  1. Configure your Azure credentials using one of the [supported methods for Azure CLI
    37     tools](https://docs.microsoft.com/en-us/cli/azure/azure-cli-configuration?view=azure-cli-latest)
    38  1. Install [Terraform](https://www.terraform.io/) and make sure it's on your `PATH`
    39  1. Configure your Terratest [Go test environment](../README.md)
    40  1. `cd test/azure`
    41  1. `go build terraform_azure_availabilityset_example_test.go`
    42  1. `go test -v -run TestTerraformAzureAvailabilitySetExample`