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

     1  # Terraform Azure Log Analytics Example
     2  
     3  This folder contains a 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 Log Analytics Workspace.
     5  
     6  - A [Log Analytics Workspace](https://docs.microsoft.com/azure/azure-monitor/platform/log-analytics-agent) that gives the module the following:
     7    - [Name](https://docs.microsoft.com/azure/azure-monitor/learn/quick-create-workspace#:~:text=%20Create%20a%20Log%20Analytics%20workspace%20in%20the,and%20region%20as%20in%20the%20deleted...%20More%20)  with the value specified in the `loganalytics_workspace_name`  output variable.
     8    - [Sku](https://docs.microsoft.com/azure/azure-monitor/learn/quick-create-workspace#:~:text=%20Create%20a%20Log%20Analytics%20workspace%20in%20the,and%20region%20as%20in%20the%20deleted...%20More%20)  with the value specified in the `loganalytics_workspace_sku`  output variable.
     9    - [RetentionPeriodInDays](https://docs.microsoft.com/azure/azure-monitor/learn/quick-create-workspace#:~:text=%20Create%20a%20Log%20Analytics%20workspace%20in%20the,and%20region%20as%20in%20the%20deleted...%20More%20)  with the value specified in the `loganalytics_workspace_retention`  output variable.
    10  
    11  Check out [test/azure/terraform_azure_loganalytics_example_test.go](/test/azure/terraform_azure_loganalytics_example_test.go) to see how you can write
    12  automated tests for this module.
    13  
    14  Note that the Log Analytics Workspace 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_loganalytics_example_test.go`
    41  1. `go test -v -run TestTerraformAzureLogAnalyticsExample`