Read this for a quick introduction on how to contribute.
This repository provides a Terraform module which:
- creates a complete Azure spoke network infrastructure including vnets, subnets, route tables and routes, network security groups and rules
- takes yaml files as input
The purpose of this module is to make a spoke network configuration as lean and simple as possible.
Copy the test folder to your machine.
In case you are curious on how the terraform-azurerm-spoke-network module is referenced, have a look at the main.tf file.
Copy the settings folder to your test folder. Inside you will find yaml files containing configuration examples used as input to main.tf.
Create a file named env.secret with following content:
#!/usr/bin/env bash
export ARM_CLIENT_ID="<client_id>"
export ARM_SUBSCRIPTION_ID="<subscription_id>"
export ARM_TENANT_ID="<tenant_id>"
export ARM_CLIENT_SECRET='<client_secret>'
export TF_VAR_subscription_id='<subscription_id_spoke>'
export TF_VAR_subscription_id_hub='<subscription_id_hub>'
Optionally add export ARM_ACCESS_KEY='<access_key>' in case you want to configure a backend storage for storing the state file.
Now sequentially execute the following commands inside of your test folder:
source env.secret
terraform fmt
terraform init
terraform validate
terraform apply -var-file=settings/terraform.tfvars