CompositionalIT / farmer

Repeatable Azure deployments with ARM templates - made easy!
https://compositionalit.github.io/farmer
MIT License
514 stars 156 forks source link

Support for VM Scale Sets and IPv6 for VMs and Load Balancers #1074

Closed ninjarobot closed 8 months ago

ninjarobot commented 8 months ago

The changes in this PR are as follows:

I have read the contributing guidelines and have completed the following:

If I haven't completed any of the tasks above, I include the reasons why here:

Below is a minimal example configuration that includes the new features, which can be used to deploy to Azure:

VM Scale Set

vmss {
    name "my-scale-set"
    capacity 3

    vm_profile (
        vm {
            username "azureuser"
            operating_system UbuntuServer_2204LTS
            vm_size Standard_B1s
            os_disk 128 StandardSSD_LRS
            diagnostics_support
        }
    )
}

VM and vNet support for IPv6

arm {
    add_resources
        [
            vnet {
                name "my-net"
                // dual-stack vNet with both IPv4 and IPv6 address space.
                add_address_spaces [ "10.100.200.0/24"; "fd0c:53d7:bb31::/48" ]

                add_subnets
                    [
                        subnet {
                            name "dual-stack-subnet"
                            // The subnet where the VM will be linked needs IPv4 and IPv6 address space.
                            add_prefixes [ "10.100.200.0/24"; "fd0c:53d7:bb31::/64" ]
                        }
                    ]
            }
            vm {
                name "my-vm"
                username "azureuser"
                vm_size Standard_B1s
                no_data_disk
                public_ip None
                operating_system UbuntuServer_2204LTS
                link_to_vnet "my-net"
                subnet_name "dual-stack-subnet"
                // An ipConfig is generated for the subnet for IPv4 so another must be added for IPv6
                add_ip_configurations
                    [
                        ipConfig {
                            subnet_name (ResourceName "dual-stack-subnet")
                            ip_v6 // will use the IPv6 address space on ths subnet
                        }
                    ]
            }
        ]
}
ninjarobot commented 8 months ago

@isaacabraham @martinbryant @OutOfScopeia is anyone available to review this?