Feature/infra - #3
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces OpenTofu/Terraform infrastructure-as-code configuration for provisioning per-client Azure environments. The implementation replaces the previously planned Bicep/ARM approach with a provider-agnostic directory structure that supports multi-cloud deployments. Each client deployment creates an isolated Azure resource group containing a VM, networking components, managed identity, and a dedicated backup container in a shared storage account.
Changes:
- Added OpenTofu configuration files defining Azure infrastructure modules for VM provisioning and backup container management
- Created reusable modules (vm/ and backup-container/) with provider-specific implementations following a contract-based architecture
- Added comprehensive documentation including design rationale, deployment workflows, and an implementation plan
- Included example client configuration (edmonton.tfvars) demonstrating per-client customization
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| infra/azure/providers.tf | Defines OpenTofu version constraints and azurerm provider configuration |
| infra/azure/variables.tf | Input contract defining client configuration parameters with validation |
| infra/azure/outputs.tf | Output contract exposing VM IP, resource group, and backup container details |
| infra/azure/main.tf | Orchestrates vm and backup_container modules |
| infra/azure/modules/vm/main.tf | Creates VM, networking (VNet, NSG, NIC), managed identity, and RBAC assignments |
| infra/azure/modules/vm/variables.tf | VM module input parameters |
| infra/azure/modules/vm/outputs.tf | VM module outputs (IP address, resource group name) |
| infra/azure/modules/backup-container/main.tf | Creates per-client blob container in shared storage account |
| infra/azure/modules/backup-container/variables.tf | Backup container module inputs |
| infra/azure/modules/backup-container/outputs.tf | Backup container module outputs (container name) |
| infra/azure/clients/edmonton.tfvars | Example client-specific configuration values |
| infra/azure/.gitignore | Excludes Terraform state files and temporary files from version control |
| infra/README.md | Updated documentation with OpenTofu deployment instructions and architecture overview |
| docs/plans/2026-02-22-infra.md | Detailed step-by-step implementation plan for the infrastructure setup |
| docs/plans/2026-02-22-infra-design.md | Architecture decisions, design rationale, and provider isolation strategy |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| tofu init | ||
| tofu plan -var-file=clients/<client>.tfvars | ||
| tofu apply -var-file=clients/<client>.tfvars | ||
|
|
||
| # 3. Note outputs for use in the RUNBOOK | ||
| terraform output public_ip_address # → set DNS A record | ||
| terraform output backup_container_name # → AZURE_CONTAINER in breedbase-client.env | ||
| tofu output public_ip_address # → set DNS A record | ||
| tofu output backup_container_name # → AZURE_CONTAINER in breedbase-client.env |
There was a problem hiding this comment.
The command examples use 'tofu' but should use 'terraform' if Terraform is being used, or the providers.tf file should be corrected to use 'terraform' block if OpenTofu is being used. OpenTofu is a fork of Terraform and uses the same 'terraform' block syntax. The 'tofu' keyword doesn't exist in either tool. Ensure consistency: if using OpenTofu, commands should be 'tofu' but the HCL block remains 'terraform'.
| # infra | ||
|
|
||
| Terraform configuration for provisioning Azure infrastructure per client deployment. | ||
| OpenTofu configuration for provisioning Azure infrastructure per client deployment. |
There was a problem hiding this comment.
Inconsistency between the README and implementation plan. The README.md describes this as "OpenTofu configuration" but the implementation plan (docs/plans/2026-02-22-infra.md) consistently refers to "Terraform". The actual providers.tf file uses 'tofu' (which is incorrect syntax). Clarify whether this infrastructure uses OpenTofu or Terraform, and ensure consistency across all documentation.
| @@ -1,5 +1,5 @@ | |||
| # infra/azure/providers.tf | |||
| terraform { | |||
| tofu { | |||
There was a problem hiding this comment.
The keyword 'tofu' should be 'terraform'. In OpenTofu (and Terraform), the configuration block must use the 'terraform' keyword, not 'tofu'. This will cause a syntax error when running tofu init or terraform init.
| tofu { | |
| terraform { |
No description provided.