azure-avd-terraform-accelerator

πŸŽ‰ NEW FEATURES - Production-Ready Enhancements

What’s New

Three new optional modules have been added to enhance your AVD deployment with enterprise-grade capabilities:

1. πŸ” Backup Module - Azure Backup for Session Hosts

Protect your session hosts with automated backup and recovery capabilities.

Features:

Enable with:

enable_backup = true

Manage golden images for consistent, fast session host deployments.

Features:

Enable with:

enable_image_gallery = true

3. πŸ“‹ Policy Module - Azure Policy for Governance

Enforce compliance, security, and operational standards automatically.

Features:

Enable with:

enable_policies = true

Quick Start

Option 1: Keep Current Deployment (Nothing Changes)

All new modules are disabled by default. Your existing deployments continue to work exactly as before.

Option 2: Enable New Features

  1. Add new variables to your terraform.tfvars:
    # Copy the new variables from the separate file
    cat variables_new_modules.tf >> variables.tf
    
  2. Use the example configuration:
    # Copy the all-features example
    cp terraform-all-features.tfvars.example terraform.tfvars
       
    # Edit with your values
    nano terraform.tfvars
    
  3. Enable features you want:
    # In terraform.tfvars
    enable_backup        = true  # Add backup protection
    enable_image_gallery = true  # Add golden images
    enable_policies      = true  # Add governance
    
  4. Deploy:
    terraform init
    terraform plan
    terraform apply
    

Files Added

New Modules

modules/
β”œβ”€β”€ backup/
β”‚   β”œβ”€β”€ main.tf       # Azure Backup resources
β”‚   β”œβ”€β”€ variables.tf  # Backup configuration options
β”‚   └── outputs.tf    # Vault and policy IDs
β”œβ”€β”€ image_gallery/
β”‚   β”œβ”€β”€ main.tf       # Shared Image Gallery resources
β”‚   β”œβ”€β”€ variables.tf  # Image definitions configuration
β”‚   └── outputs.tf    # Gallery and image IDs
└── policy/
    β”œβ”€β”€ main.tf       # Azure Policy assignments
    β”œβ”€β”€ variables.tf  # Policy configuration options
    └── outputs.tf    # Policy assignment IDs

Documentation

Updated Files


What Happens When You Enable Each Module

Backup Module (enable_backup = true)

Resources Created:

Cost: ~$10-30/VM/month (varies by retention and region)

When to Enable:


Resources Created:

Cost: ~$5/month

When to Enable:


Policy Module (enable_policies = true)

Resources Created:

Cost: Free

When to Enable:


Configuration Options

Backup Module Variables

enable_backup                  = true
backup_frequency               = "Daily"          # Daily or Weekly
backup_time                    = "02:00"          # 24-hour format
backup_timezone                = "UTC"
backup_daily_retention_count   = 30               # 7-9999 days
backup_weekly_retention_count  = 12               # 0-5163 weeks
backup_monthly_retention_count = 12               # 0-1188 months
backup_yearly_retention_count  = 5                # 0-99 years
enable_image_gallery           = true
create_win11_image_definition  = true
create_win10_image_definition  = false
image_builder_principal_id     = ""               # Optional: Service Principal for CI/CD

Policy Module Variables

enable_policies                = true
policy_require_environment_tag = true
policy_allowed_vm_sizes        = ["Standard_D2s_v5", "Standard_D4s_v5", ...]
policy_deploy_antimalware      = true
policy_audit_disk_encryption   = true
policy_enable_vm_diagnostics   = true

Migration Path

If you have an existing deployment:

1. Review RECOMMENDATIONS.md

Understand all best practices and decide which features you need.

2. Update Variables

Add new variables to your existing variables.tf:

cat variables_new_modules.tf >> variables.tf

3. Update Configuration

Add feature flags to your terraform.tfvars:

# Start with backup (safest, most valuable)
enable_backup = true

# Add image gallery later
enable_image_gallery = false

# Add policies last
enable_policies = false

4. Test in Dev/Test First

terraform plan  # Review changes
terraform apply # Apply to dev/test environment

5. Gradually Enable Features


Support & Documentation


Backward Compatibility

βœ… 100% backward compatible - All new features are disabled by default.

Your existing deployments will continue to work without any changes. The new modules are only created if you explicitly enable them.


Next Steps

  1. Read RECOMMENDATIONS.md for full best practices
  2. Review terraform-all-features.tfvars.example
  3. Enable features one at a time
  4. Test in non-production first
  5. Monitor costs and compliance

Questions?

Check the documentation files or review the module source code in modules/ directory. All modules are fully commented and include validation rules.

Happy deploying! πŸš€