pulumi_wasm_providers_azure_mini::compute

Module windows_virtual_machine_scale_set

source
Expand description

Manages a Windows Virtual Machine Scale Set.

§Disclaimers

Note: This resource will only create Virtual Machine Scale Sets with the Uniform Orchestration Mode. For Virtual Machine Scale Sets with Flexible orchestration mode, use azure.compute.OrchestratedVirtualMachineScaleSet. Flexible orchestration mode is recommended for workloads on Azure.

Note: All arguments including the administrator login and password will be stored in the raw state as plain-text. Read more about sensitive data in state.

Note: This provider will automatically update & reimage the nodes in the Scale Set (if Required) during an Update - this behaviour can be configured using the features setting within the Provider block.

Note: This resource does not support Unmanaged Disks. If you need to use Unmanaged Disks you can continue to use the azure.compute.ScaleSet resource instead

§Example Usage

This example provisions a basic Windows Virtual Machine Scale Set on an internal network.

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let example = resource_group::create(
        "example",
        ResourceGroupArgs::builder()
            .location("West Europe")
            .name("example-resources")
            .build_struct(),
    );
    let exampleVirtualNetwork = virtual_network::create(
        "exampleVirtualNetwork",
        VirtualNetworkArgs::builder()
            .address_spaces(vec!["10.0.0.0/16",])
            .location("${example.location}")
            .name("example-network")
            .resource_group_name("${example.name}")
            .build_struct(),
    );
    let exampleWindowsVirtualMachineScaleSet = windows_virtual_machine_scale_set::create(
        "exampleWindowsVirtualMachineScaleSet",
        WindowsVirtualMachineScaleSetArgs::builder()
            .admin_password("P@55w0rd1234!")
            .admin_username("adminuser")
            .computer_name_prefix("vm-")
            .instances(1)
            .location("${example.location}")
            .name("example-vmss")
            .network_interfaces(
                vec![
                    WindowsVirtualMachineScaleSetNetworkInterface::builder()
                    .ipConfigurations(vec![WindowsVirtualMachineScaleSetNetworkInterfaceIpConfiguration::builder()
                    .name("internal").primary(true).subnetId("${internal.id}")
                    .build_struct(),]).name("example").primary(true).build_struct(),
                ],
            )
            .os_disk(
                WindowsVirtualMachineScaleSetOsDisk::builder()
                    .caching("ReadWrite")
                    .storageAccountType("Standard_LRS")
                    .build_struct(),
            )
            .resource_group_name("${example.name}")
            .sku("Standard_F2")
            .source_image_reference(
                WindowsVirtualMachineScaleSetSourceImageReference::builder()
                    .offer("WindowsServer")
                    .publisher("MicrosoftWindowsServer")
                    .sku("2016-Datacenter-Server-Core")
                    .version("latest")
                    .build_struct(),
            )
            .build_struct(),
    );
    let internal = subnet::create(
        "internal",
        SubnetArgs::builder()
            .address_prefixes(vec!["10.0.2.0/24",])
            .name("internal")
            .resource_group_name("${example.name}")
            .virtual_network_name("${exampleVirtualNetwork.name}")
            .build_struct(),
    );
}

§Import

Windows Virtual Machine Scale Sets can be imported using the resource id, e.g.

$ pulumi import azure:compute/windowsVirtualMachineScaleSet:WindowsVirtualMachineScaleSet example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/virtualMachineScaleSets/scaleset1

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments