This is the terraform repo for the Equal Vote Coalition. It's currently used to deploy a Kubernetes cluster to Azure.
For full onboarding follow our documentation
Based on:
export SUBSCRIPTION_ID="your Azure subscription ID"
az ad sp create-for-rbac --name terraform --role="Contributor" --scopes="/subscriptions/$SUBSCRIPTION_ID"
ARM_CLIENT_ID="set this to the the appId value"
ARM_SUBSCRIPTION_ID="your Azure subscription ID"
ARM_TENANT_ID="set this to the tenant value"
ARM_CLIENT_SECRET="set this to the password value"
Create Azure resource group, storage account, and storage container that will be used to store Terraform state:
RESOURCE_GROUP_NAME=tfstate
STORAGE_ACCOUNT_NAME=equalvoteterraform
CONTAINER_NAME=tfstate
# Create resource group
az group create --name $RESOURCE_GROUP_NAME --location westus2
# Create storage account
az storage account create --resource-group $RESOURCE_GROUP_NAME --name $STORAGE_ACCOUNT_NAME --sku Standard_LRS --encryption-services blob
# Create blob container
az storage container create --name $CONTAINER_NAME --account-name $STORAGE_ACCOUNT_NAME
az storage account keys list --resource-group $RESOURCE_GROUP_NAME --account-name $STORAGE_ACCOUNT_NAME --query '[0].value' -o tsv
az aks get-credentials --resource-group equalvote --name equalvote
terraform init -upgrade Should see changes to .terraform.lock.hcl. Commit them.
Should we be using Managed Identity instead of Service Principal? https://arnav.au/2023/09/08/azure-managed-identity-vs-service-principal/ https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/managed_service_identity