Skip to content

Latest commit

History

History

hub-spoke-azure

Hub-spoke network topology on Azure

To understand it, please read the article Learning hub-spoke with Packet Tracer and deploying it through Terraform on Azure.

Prerequisites

  • Create a service principal on Azure.
  • Configure the following environment variables in docker-compose.yml file:
    • ARM_CLIENT_ID
    • ARM_CLIENT_SECRET
    • ARM_TENANT_ID
    • ARM_SUBSCRIPTION_ID

Running the Terraform code

Run the following command to start the container:

docker compose run --rm docker-client-tf-did bash

To create the infrastructure, run the following command:

terraform init
terraform apply

Running static code analysers

tfsec .
terrascan scan --iac-type terraform

Authenticating on Azure CLI

Inside the container, run the following command:

az login \
--service-principal \
-t $ARM_TENANT_ID \
-u $ARM_CLIENT_ID \
-p $ARM_CLIENT_SECRET

Now, for example, you can list SKU's available to create virtual machines by running:

az vm list-skus --location westus2 --output table