- Add Well-Architected Framework implementation guide covering all 5 pillars - Create Well-Architected Terraform module (cost, operations, performance, reliability, security) - Add Cloud for Sovereignty compliance guide - Implement data residency policies and enforcement - Add operational sovereignty features (CMK, independent logging) - Configure compliance monitoring and reporting - Add budget management and cost optimization - Implement comprehensive security controls - Add backup and disaster recovery automation - Create performance optimization resources (Redis, Front Door) - Add operational excellence tools (Log Analytics, App Insights, Automation)
Terraform Infrastructure
Terraform configuration for The Order infrastructure on Azure.
Default Region: West Europe (westeurope)
Policy: No US Commercial or Government regions
Structure
versions.tf- Terraform and provider version constraintsmain.tf- Azure provider configurationvariables.tf- Variable definitionsoutputs.tf- Output definitionsresource-groups.tf- Resource group definitionsstorage.tf- Storage account definitionsmodules/- Reusable Terraform modules (to be created)AZURE_RESOURCE_PROVIDERS.md- Required resource providers documentationEXECUTION_GUIDE.md- Step-by-step execution guide
Prerequisites
Before using Terraform:
-
Run Azure setup scripts (from project root):
./infra/scripts/azure-setup.sh ./infra/scripts/azure-register-providers.sh -
Verify Azure CLI is installed and logged in:
az --version az account show -
Ensure required resource providers are registered: See
AZURE_RESOURCE_PROVIDERS.mdfor complete list.
Quick Start
# Navigate to Terraform directory
cd infra/terraform
# Initialize Terraform
terraform init
# Review what will be created
terraform plan
# Apply changes
terraform apply
Detailed Execution
See EXECUTION_GUIDE.md for comprehensive step-by-step instructions.
Environments
Environments are managed via the environment variable:
dev- Development environmentstage- Staging environmentprod- Production environment
# Deploy to specific environment
terraform plan -var="environment=dev"
terraform apply -var="environment=dev"
Resources
Currently Defined
- ✅ Resource Groups
- ✅ Storage Accounts (application data and Terraform state)
- ✅ Storage Containers
To Be Created
- ⏳ Azure Kubernetes Service (AKS) cluster
- ⏳ Azure Database for PostgreSQL
- ⏳ Azure Key Vault
- ⏳ Azure Container Registry (ACR)
- ⏳ Virtual Networks and Subnets
- ⏳ Application Gateway / Load Balancer
- ⏳ Azure Monitor and Log Analytics
Configuration
Default Region
Default region is West Europe (westeurope). US regions are not allowed.
To use a different region:
terraform plan -var="azure_region=northeurope"
Variables
Key variables (see variables.tf for complete list):
azure_region- Azure region (default:westeurope)environment- Environment name (dev,stage,prod)project_name- Project name (default:the-order)create_terraform_state_storage- Create state storage (default:true)
Secrets Management
Secrets are managed using:
- Azure Key Vault (to be configured)
- External Secrets Operator for Kubernetes (to be configured)
- SOPS for local development (optional)
State Management
Terraform state is stored in Azure Storage Account:
- First deployment creates storage account locally
- After creation, configure remote backend in
versions.tf - Re-initialize with
terraform init -migrate-state
See EXECUTION_GUIDE.md for detailed instructions.
Outputs
Key outputs (see outputs.tf for complete list):
resource_group_name- Main resource group namestorage_account_name- Application data storage accountazure_region- Azure region being used
View outputs:
terraform output
terraform output resource_group_name
Best Practices
- ✅ Always review
terraform planbefore applying - ✅ Use workspaces for multiple environments
- ✅ Never commit
.tfstatefiles - ✅ Use remote state backend
- ✅ Enable versioning on storage accounts
- ✅ Use
.tfvarsfiles for environment-specific values
Troubleshooting
Common issues and solutions:
Resource Provider Not Registered
./infra/scripts/azure-register-providers.sh
Quota Exceeded
./infra/scripts/azure-check-quotas.sh
# Request quota increase in Azure Portal
Invalid Region
- Ensure region doesn't start with
us - Default is
westeurope - See validation in
variables.tf
See EXECUTION_GUIDE.md for more troubleshooting tips.
Documentation
- Execution Guide:
EXECUTION_GUIDE.md- Step-by-step deployment instructions - Resource Providers:
AZURE_RESOURCE_PROVIDERS.md- Required providers and registration - Setup Scripts:
../scripts/README.md- Azure CLI setup scripts - Deployment Review:
../../docs/reports/DEPLOYMENT_READINESS_REVIEW.md- Overall deployment status
Next Steps
- ✅ Run setup scripts to register providers
- ✅ Initialize Terraform
- ✅ Create initial infrastructure (resource groups, storage)
- ⏳ Configure remote state backend
- ⏳ Add additional resources (AKS, PostgreSQL, Key Vault, etc.)
See EXECUTION_GUIDE.md for detailed step-by-step instructions.