Quick start (Terraform)
If you just want to see something work, follow these five steps. Prefer Microsoft’s native IaC? See Quick start (Bicep) for the equivalent flow.
1. Bootstrap the state backend
git clone https://github.com/travishankins/azure-launchpad.gitcd azure-launchpadaz loginexport ARM_SUBSCRIPTION_ID=<subscription-id>./scripts/bootstrap-state.shCopy the storage_account_name printed at the end.
2. Initialize Terraform
cd infra/terraform/foundationterraform init \ -backend-config="resource_group_name=rg-tfstate-contoso-wcus" \ -backend-config="storage_account_name=<from step 1>" \ -backend-config="container_name=tfstate" \ -backend-config="key=foundation.baseline.tfstate"3. Pick a scenario (workspace)
terraform workspace select -or-create baseline4. Plan
terraform plan \ -var "subscription_id=$ARM_SUBSCRIPTION_ID" \ -var-file=scenarios/baseline.tfvars \ -out=tfplanReview the plan output carefully.
5. Apply
terraform apply tfplanThat’s it. To switch scenarios:
terraform workspace select -or-create firewallterraform apply -var "subscription_id=$ARM_SUBSCRIPTION_ID" -var-file=scenarios/firewall.tfvarsTip — use the deployment wizard to generate a
wizard.auto.tfvarsfile tailored to your customer’s needs.