Files
firezone/terraform/environments/performance
Jamil bf1abcfbfa feat(devops): Add example for spinning up performance testing VMs on Azure (#4647)
Sets up boilerplate for Azure performance testing infra.

They have some really interesting high performance VMs that would be
fitting for our use cases, including [ones with RDMA-enabled Infiniband
networking
cards](https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/enable-infiniband)
if we really want to go wild.
2024-05-17 16:39:21 +00:00
..

Performance Terraform environment

This directory contains terraform examples for spinning up VMs on Azure to be used for performance testing.

This is primarily meant to be used internal by the Firezone Team at this time, but anyone can use the scripts here by changing the variables in a local terraform.tfvars as needed.

Get started

  1. Install Terraform if you haven't already.

  2. Install the Azure CLI if you haven't already.

  3. Clone this repository, and cd to this directory.

  4. Run terraform init to initialize the directory.

  5. Login to Azure using the Azure CLI with az login.

  6. Find the subscription ID you want to use with az account subscription list. If unsure, contact your Azure admin to avoid incurring billing charges under the wrong billing subscription.

  7. Generate a keypair to use for your own admin SSH access (must be RSA):

    ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa.azure
    
  8. Obtain terraform.tfvars using one of the following methods:

    1. Your team's shared credentials vault (e.g. 1password)

    2. Your Azure admin

    3. Or, generate it by following the instructions at https://developer.hashicorp.com/terraform/tutorials/azure-get-started/azure-build and populating a terraform.tfvars file in this directory:

      # Azure billing subscription ID
      subscription_id = "SUBSCRIPTION-ID-FROM-PREVIOUS-STEP"
      
      # Obtain these variables by following the guide above
      arm_client_id = "AZURE-SERVICE-PRINCIPAL-CLIENT-ID"
      arm_client_secret = "AZURE-SERVICE-PRINCIPAL-CLIENT-SECRET"
      arm_tenant_id = "AZURE-SERVICE-PRINCIPAL-TENANT-ID"
      
      # All VMs need a public RSA SSH key specified for the admin user. Insert yours below.
      admin_ssh_public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC7..."
      
      # Set your own naming prefix to avoid clobbering others' resources
      naming_prefix = "CHANGEME"
      
  9. Run terraform apply to create the resources.

  10. Done! You can now SSH into your VM like so:

    # Login using the name of resources used in Terraform config above
    az ssh vm \
     --resource-group CHANGEME-rg-westus2 \
     --vm-name CHANGEME-vm-westus2 \
     --private-key-file ~/.ssh/id_rsa.azure \
     --local-user adminuser