Skip to content

Commit

Permalink
update the version and location
Browse files Browse the repository at this point in the history
  • Loading branch information
sweanan committed Jun 13, 2023
1 parent 8ad606f commit a7d0356
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
31 changes: 31 additions & 0 deletions examples/azure/terraform-azure-datafactory-example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Terraform Azure Data Factory Example

This folder contains a Terraform module that deploys resources in [Azure](https://azure.microsoft.com/) to demonstrate how you can use Terratest to write automated tests for your Azure Terraform code.
This module deploys a Data Factory.

- A [Azure MySQL Database](https://azure.microsoft.com/en-us/products/data-factory).

Check out [test/azure/terraform_azure_datafactory_example_test.go](./../../../test/azure/terraform_azure_datafactory_example_test.go) to see how you can write automated tests for this module and validate the configuration of the parameters and options.

**WARNING**: This module and the automated tests for it deploy real resources into your Azure account which can cost you money.

## Running this module manually
1. Sign up for [Azure](https://azure.microsoft.com/).
1. Configure your Azure credentials using one of the [supported methods for Azure CLI
tools](https://docs.microsoft.com/en-us/cli/azure/azure-cli-configuration?view=azure-cli-latest)
1. Install [Terraform](https://www.terraform.io/) and make sure it's on your `PATH`.
1. Ensure [environment variables](../README.md#review-environment-variables) are available
1. Run `terraform init`
1. Run `terraform apply`
1. When you're done, run `terraform destroy`.


## Running automated tests against this module
1. Sign up for [Azure](https://azure.microsoft.com/)
1. Configure your Azure credentials using one of the [supported methods for Azure CLI
tools](https://docs.microsoft.com/en-us/cli/azure/azure-cli-configuration?view=azure-cli-latest)
1. Install [Terraform](https://www.terraform.io/) and make sure it's on your `PATH`
1. Configure your Terratest [Go test environment](../README.md)
1. `cd test/azure`
1. `go build terraform_azure_datafactory_example_test.go`
2. `go test -v -timeout 60m -tags azure -run TestTerraformAzureDataFactoryExample`
2 changes: 1 addition & 1 deletion examples/azure/terraform-azure-datafactory-example/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "azurerm" {
version = "~>2.29.0"
version = "~>2.93.0"
features {}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
variable "location" {
description = "The supported azure location where the resource exists"
type = string
default = "usgovvirginia"
default = "West US2"
}

variable "postfix" {
Expand Down
2 changes: 1 addition & 1 deletion test/azure/terraform_azure_datafactory_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestTerraformAzureDataFactoryExample(t *testing.T) {

uniquePostfix := strings.ToLower(random.UniqueId())
expectedDataFactoryProvisioningState := "Succeeded"
expectedLocation := "usgovvirginia"
expectedLocation := "West US2"

// website::tag::1:: Configure Terraform setting up a path to Terraform code.
terraformOptions := &terraform.Options{
Expand Down

0 comments on commit a7d0356

Please sign in to comment.