Appendix: Required configuration

When using the root main.tf file from the Materialize on Azure Terraform module, the following configurations are required. 1

Required variables

When using the root main.tf file from the Materialize on Azure Terraform module, the following variables must be set: 1

Variable
resource_group_name = <string>
database_config = {
  password            = <string>  # required
  # sku_name          = <string>  # optional
  # postgres_version  = <string>  # optional
  # username          = <string>  # optional
  # db_name           = <string>  # optional
}
network_config = {     # required starting in v0.2.0
  vnet_address_space   = string
  subnet_cidr          = string
  postgres_subnet_cidr = string
  service_cidr         = string
  docker_bridge_cidr   = string
}

For a list of all variables, see the README.md or the variables.tf file.

Resource group

When using the root main.tf file from the Materialize on Azure Terraform module, an Azure Resource Group azurerm_resource_group is required.1 You can either create a new resource group or use an existing resource group:

  • To create a new resource group, declare the resource group to create in your configuration:

    resource "azurerm_resource_group" "materialize" {
      name     = var.resource_group_name
      location = var.location                    # Defaults to eastus2
      tags     = var.tags                        # Optional
    }
    
  • To use an existing resource group, set the resource_group_name variable to that group’s name.

Required providers

When using the root main.tf file from the Materialize on Azure Terraform module v0.2.0+, the following provider declarations are required: 1

provider "azurerm" {
  # Set the Azure subscription ID here or use the ARM_SUBSCRIPTION_ID environment variable
  # subscription_id = "XXXXXXXXXXXXXXXXXXX"

  # Specify addition Azure provider configuration as needed

  features { }
}


provider "kubernetes" {
  host                   = module.aks.cluster_endpoint
  client_certificate     = base64decode(module.aks.kube_config[0].client_certificate)
  client_key             = base64decode(module.aks.kube_config[0].client_key)
  cluster_ca_certificate = base64decode(module.aks.kube_config[0].cluster_ca_certificate)
}

provider "helm" {
  kubernetes {
    host                   = module.aks.cluster_endpoint
    client_certificate     = base64decode(module.aks.kube_config[0].client_certificate)
    client_key             = base64decode(module.aks.kube_config[0].client_key)
    cluster_ca_certificate = base64decode(module.aks.kube_config[0].cluster_ca_certificate)
  }
}

  1. If using the examples/simple/main.tf, the example configuration handles them for you. ↩︎ ↩︎ ↩︎ ↩︎

Back to top ↑