github.com/darmach/terratest@v0.34.8-0.20210517103231-80931f95e3ff/examples/azure/terraform-azure-keyvault-example/README.md (about) 1 # Terraform Azure Keyvault 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 a Key Vault with one secret, key, and certificate each. 5 6 - A [Key Vault](https://azure.microsoft.com/services/key-vault/) that gives the module the following: 7 - [Secret](https://docs.microsoft.com/azure/key-vault/general/about-keys-secrets-certificates) with the value specified in the `secret_name` output variable. 8 - [Key](https://docs.microsoft.com/azure/key-vault/general/about-keys-secrets-certificates) with the value specified in the `key_name` output variable. 9 - [Certificate](https://docs.microsoft.com/azure/key-vault/general/about-keys-secrets-certificates) with the value specified in the `certificate_name` output variable. 10 11 Check out [test/azure/terraform_azure_keyvault_example_test.go](/test/azure/terraform_azure_keyvault_example_test.go) to see how you can write 12 automated tests for this module. 13 14 Note that the Key Vault in this module don't actually do anything; it just runs the resources for 15 demonstration purposes. 16 17 **WARNING**: This module and the automated tests for it deploy real resources into your Azure account which can cost you 18 money. The resources are all part of the [Azure Free Account](https://azure.microsoft.com/free/), so if you haven't used that up, 19 it should be free, but you are completely responsible for all Azure charges. 20 21 ## Running this module manually 22 23 1. Sign up for [Azure](https://azure.microsoft.com/) 24 1. Configure your Azure credentials using one of the [supported methods for Azure CLI 25 tools](https://docs.microsoft.com/cli/azure/azure-cli-configuration?view=azure-cli-latest) 26 1. Install [Terraform](https://www.terraform.io/) and make sure it's on your `PATH` 27 1. Ensure [environment variables](../README.md#review-environment-variables) are available 28 1. Run `terraform init` 29 1. Run `terraform apply` 30 1. When you're done, run `terraform destroy` 31 32 ## Running automated tests against this module 33 34 1. Sign up for [Azure](https://azure.microsoft.com/) 35 1. Configure your Azure credentials using one of the [supported methods for Azure CLI 36 tools](https://docs.microsoft.com/cli/azure/azure-cli-configuration?view=azure-cli-latest) 37 1. Install [Terraform](https://www.terraform.io/) and make sure it's on your `PATH` 38 1. Configure your Terratest [Go test environment](../README.md) 39 1. `cd test/azure` 40 1. `go build terraform_azure_keyvault_example_test.go` 41 1. `go test -v -run TestTerraformAzureKeyVaultExample`