github.com/darmach/terratest@v0.34.8-0.20210517103231-80931f95e3ff/examples/azure/terraform-azure-monitor-example/README.md (about) 1 # Terraform Azure Monitor 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 Storage Account and Azure Azure Key Vault with an Azure Monitor Diagnostic Setting. 5 6 - A [Diagnostic Setting](https://docs.microsoft.com/azure/azure-monitor/platform/diagnostic-settings-template) 7 8 Check out [test/azure/terraform_azure_monitor_example_test.go](/test/azure/terraform_azure_monitor_example_test.go) to see how you can write 9 automated tests for this module. 10 11 Note that the resources deployed in this module don't actually do anything; it just runs the resources for 12 demonstration purposes. 13 14 **WARNING**: This module and the automated tests for it deploy real resources into your Azure account which can cost you 15 money. The resources are all part of the [Azure Free Account](https://azure.microsoft.com/free/), so if you haven't used that up, 16 it should be free, but you are completely responsible for all Azure charges. 17 18 ## Running this module manually 19 20 1. Sign up for [Azure](https://azure.microsoft.com/) 21 1. Configure your Azure credentials using one of the [supported methods for Azure CLI 22 tools](https://docs.microsoft.com/cli/azure/azure-cli-configuration?view=azure-cli-latest) 23 1. Install [Terraform](https://www.terraform.io/) and make sure it's on your `PATH` 24 1. Ensure [environment variables](../README.md#review-environment-variables) are available 25 1. Run `terraform init` 26 1. Run `terraform apply` 27 1. When you're done, run `terraform destroy` 28 29 ## Running automated tests against this module 30 31 1. Sign up for [Azure](https://azure.microsoft.com/). 32 1. Configure your Azure credentials using one of the [supported methods for Azure CLI 33 tools](https://docs.microsoft.com/cli/azure/azure-cli-configuration?view=azure-cli-latest). 34 1. Install [Terraform](https://www.terraform.io/) and make sure it's on your `PATH`. 35 1. [Review environment variables](#review-environment-variables). 36 1. Install [Golang](https://golang.org/) and make sure this code is checked out into your `GOPATH`. 37 1. `cd test` 38 1. Make sure [the azure-sdk-for-go versions match](#check-go-dependencies) in [/go.mod](/go.mod) and in [test/azure/terraform_azure_monitor_example_test.go](/test/azure/terraform_azure_monitor_example_test.go). 39 1. `go build test/azure/terraform_azure_monitor_example_test.go` 40 1. `go test -v -run TestTerraformAzureMonitorExample`