MATIH Platform is in active MVP development. Documentation reflects current implementation status.
18. CI/CD & Build System
Environments

Environments

Terraform environments define the cloud infrastructure configuration for each deployment target. Each environment has its own state file, variable values, and provider configuration.

Source: infrastructure/terraform/environments/


Available Environments

EnvironmentPathCloudPurpose
azure-matihlabsenvironments/azure-matihlabs/AzurePrimary development environment

Environment Structure

environments/azure-matihlabs/
  main.tf              -- Root module, module composition
  variables.tf         -- Input variable definitions
  outputs.tf           -- Output definitions
  terraform.tfvars     -- Variable values (no secrets)
  providers.tf         -- Azure provider configuration
  backend.tf           -- Remote state configuration

Azure MatiH Labs Environment

Module Composition

The root main.tf composes the following modules:

ModulePurpose
azure/networkingVNet, subnets, DNS zones
azure/kubernetes/control-planeAKS cluster
azure/keyvaultKey Vault for secrets
azure/storageStorage accounts
azure/monitoringLog Analytics workspace
azure/cognitive-servicesAzure OpenAI
azure/governancePolicy assignments
platform/credentialsCross-module credential management

Output Values

Terraform outputs are consumed by subsequent CD pipeline stages:

OutputDescriptionConsumer
acr_nameContainer Registry nameImage build and deploy stages
acr_login_serverACR FQDNHelm values for image.repository
aks_cluster_nameAKS cluster namekubectl credential retrieval
resource_group_nameResource groupAzure CLI commands
key_vault_nameKey Vault nameESO configuration
dns_zone_nameDNS zoneIngress configuration

State Management

SettingValue
BackendAzure Storage (azurerm)
State fileterraform.tfstate in a blob container
LockingAzure Blob lease-based locking
EncryptionServer-side encryption enabled

Adding a New Environment

  1. Create a new directory under environments/
  2. Copy the structure from an existing environment
  3. Update terraform.tfvars with environment-specific values
  4. Configure the remote backend for state storage
  5. Run terraform init and terraform plan

Security

RuleImplementation
No secrets in tfvarsUse random_password + Key Vault
State encryptionAzure Storage SSE
Access controlAzure RBAC on state storage
Plan reviewRequired before apply in CI/CD

Related Pages