## Description
This architecture deploys an Azure SQL IaaS (Infrastructure-as-a-Service) solution with Azure Backup for high availability, data protection.
It consists of multiple components including Azure Virtual Machines running SQL Server, Availability Sets for high availability, Storage Accounts for logging and diagnostics, and Azure Backup (Recovery Services Vault) for data protection.
**N.B:**
- The Terraform code is automatically generated with best practices and contains variables that you can customize to fir your needs.
- You have full control to change, add, delete resources or their configuration. The newly generated code will reflect these changes.
- You can replace some resources with Terraform modules.
> terraform apply status: successful
>
## Architecture components
## Requirements
| Name | Configuration |
|------------------------|-----------------------------------------------------------|
| **Terraform** | all versions |
| **Provider** | `azurerm` provider version `>=3.0`|
| **Provider version** | >= 5.33.0 |
| **Access** | Admin access |
| **Subscription** | An active Azure subscription is required. |
| **Resource Group** | A resource group must be created or referenced. |
| **Virtual Network** | A VNet must exist with proper address space allocation. |
| **Subnets** | At least two subnets (`snet-vm1`, `snet-vm2`) are required. |
| **Network Interface** | Each VM must have an attached NIC. |
| **Storage Accounts** | Storage accounts for logging and boot diagnostics. |
| **Virtual Machines** | At least two VMs (`vm1`, `vm2`) must be deployed. |
| **Availability Sets** | Availability sets (`sql-avset-1`, `sql-avset-2`) are required. |
| **SQL Licensing** | PAYG licensing model is used for SQL VMs. |
| **Backup Policy** | A VM backup policy must be defined in a Recovery Vault. |
| **Recovery Vault** | A Recovery Services Vault is required for backups. |
| **Admin Credentials** | Admin usernames and passwords must be set in variables. |
| **DNS Configuration** | Private DNS configuration for SQL connectivity. |
| **Security Rules** | Proper network security rules must be applied. |
| **Tags** | Resource tagging should be implemented for organization. |
## How to use the architecture
Clone the architecture and modify the following variables according to your needs:
| Variable Name | Description |
|-------------------------------------|--------------------------------------------------|
| `VM_SIZE_SQL` | Specifies the SQL VM size. |
| `adminUser_password` | Password for the admin user. |
| `admin_password` | General admin password. |
| `admin_username` | Admin username for VM access. |
| `availability_set1_name` | Name of the first availability set. |
| `availability_set2_name` | Name of the second availability set. |
| `backup_policy_vm_name` | Name of the backup policy for the VM. |
| `backup_policy_vm_time` | Time at which the backup policy runs. |
| `computer2_name` | Computer name for VM2. |
| `computer_name` | Computer name for VM1. |
| `db_username` | Database admin username (default: `adminuser`). |
| `disk_size_gb` | Disk size in GB for the VM. |
| `env` | Deployment environment (e.g., `prod`, `dev`). |
| `image_version` | Version of the OS image for VM deployment. |
| `instance_port` | Port for the instance (default: `80`). |
| `lb_path` | Load Balancer path for health checks (default: `/`). |
| `lb_port` | Load Balancer port (default: `80`). |
| `location` | Azure region where resources are deployed. |
| `location_short` | Short code for the Azure region. |
| `log_st1_name` | Name of the first storage account for logs. |
| `log_st2_name` | Name of the second storage account for logs. |
| `nic1_ipconf_name` | Name of the IP configuration for NIC1. |
| `nic2_ipconf_name` | Name of the IP configuration for NIC2. |
| `offer` | Offer type for the VM image. |
| `office_ip` | IP address of the office network. |
| `prefix` | Prefix for naming resources. |
| `projet` | Name of the project. |
| `publisher` | Publisher of the OS image. |
| `recovery_vault_name` | Name of the Recovery Services Vault. |
| `sku` | SKU type for the VM image. |
| `snet2_adress_prefix` | Address prefix for VM2 subnet. |
| `snet_adress_prefix` | Address prefix for VM1 subnet. |
| `sql_connectivity_update_password` | SQL connectivity update password. |
| `sql_connectivity_update_username` | SQL connectivity update username. |
| `tags` | Map of tags to apply to resources. |
| `vm1_name` | Name of the primary VM. |
| `vm2_name` | Name of the secondary VM. |
| `vm_size` | Size of the VM instance. |
| `vnet2_adress_prefix` | Address prefix for VM2 virtual network. |
| `vnet_adress_prefix` | Address prefix for VM1 virtual network. |
| | |
**N.B:**
- Feel free to remove the resources that are not relevant to your use-case.
- Some variables have default values, please change it if it doesn't fit your deployment.
## Maintainer(s)
You can reach out to these maintainers if you need help or assistance:
- [Brainboard team](mailto:support@brainboard.co)
Brainboard is an AI driven platform to visually design and manage cloud infrastructure, collaboratively. It's the only solution that automatically generates IaC code for any cloud provider, with an embedded CI/CD.