-
Azure CLI
az --version az login az account show
-
Terraform
terraform version
-
Get your subscription ID:
az account show --query id -o tsv
-
Copy the example variables file:
cp terraform.tfvars.example terraform.tfvars
-
Edit
terraform.tfvarsand set:subscription_id: Your Azure subscription IDresource_group_name: Your desired resource group namelocation: Your preferred Azure region
Edit modules-config.json to enable the modules you want:
Minimal Example (just storage accounts):
{
"modules": {
"storage_account": { "enabled": true, "count": 1 },
"app_service": { "enabled": false, "count": 0 },
"virtual_network": { "enabled": false, "count": 0 },
"key_vault": { "enabled": false, "count": 0 },
"app_service_plan": { "enabled": false, "count": 0 },
"container_registry": { "enabled": false, "count": 0 },
"kubernetes_cluster": { "enabled": false, "count": 0 },
"sql_server": { "enabled": false, "count": 0 },
"function_app": { "enabled": false, "count": 0 },
"log_analytics_workspace": { "enabled": false, "count": 0 }
}
}# Initialize Terraform
terraform init
# Review what will be created
terraform plan
# Deploy (type 'yes' when prompted)
terraform apply# View all outputs
terraform output
# Check resources in Azure
az resource list --resource-group <your-resource-group-name> -o tableEnable: app_service, app_service_plan, storage_account, key_vault
Enable: container_registry, kubernetes_cluster, log_analytics_workspace
Enable: function_app, app_service_plan, storage_account
Enable: sql_server, key_vault, virtual_network
terraform destroy- Read the full README.md for detailed documentation
- Customize modules in the
modules/directory - Add your own modules following the existing pattern