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