All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.compute.VirtualMachineArgs Maven / Gradle / Ivy

// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.compute;

import com.pulumi.azure.compute.inputs.VirtualMachineAdditionalCapabilitiesArgs;
import com.pulumi.azure.compute.inputs.VirtualMachineBootDiagnosticsArgs;
import com.pulumi.azure.compute.inputs.VirtualMachineIdentityArgs;
import com.pulumi.azure.compute.inputs.VirtualMachineOsProfileArgs;
import com.pulumi.azure.compute.inputs.VirtualMachineOsProfileLinuxConfigArgs;
import com.pulumi.azure.compute.inputs.VirtualMachineOsProfileSecretArgs;
import com.pulumi.azure.compute.inputs.VirtualMachineOsProfileWindowsConfigArgs;
import com.pulumi.azure.compute.inputs.VirtualMachinePlanArgs;
import com.pulumi.azure.compute.inputs.VirtualMachineStorageDataDiskArgs;
import com.pulumi.azure.compute.inputs.VirtualMachineStorageImageReferenceArgs;
import com.pulumi.azure.compute.inputs.VirtualMachineStorageOsDiskArgs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class VirtualMachineArgs extends com.pulumi.resources.ResourceArgs {

    public static final VirtualMachineArgs Empty = new VirtualMachineArgs();

    /**
     * An `additional_capabilities` block as defined below.
     * 
     */
    @Import(name="additionalCapabilities")
    private @Nullable Output additionalCapabilities;

    /**
     * @return An `additional_capabilities` block as defined below.
     * 
     */
    public Optional> additionalCapabilities() {
        return Optional.ofNullable(this.additionalCapabilities);
    }

    /**
     * The ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created.
     * 
     */
    @Import(name="availabilitySetId")
    private @Nullable Output availabilitySetId;

    /**
     * @return The ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created.
     * 
     */
    public Optional> availabilitySetId() {
        return Optional.ofNullable(this.availabilitySetId);
    }

    /**
     * A `boot_diagnostics` block as defined below.
     * 
     */
    @Import(name="bootDiagnostics")
    private @Nullable Output bootDiagnostics;

    /**
     * @return A `boot_diagnostics` block as defined below.
     * 
     */
    public Optional> bootDiagnostics() {
        return Optional.ofNullable(this.bootDiagnostics);
    }

    /**
     * Should the Data Disks (either the Managed Disks / VHD Blobs) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
     * 
     * > **Note:** This setting works when instance is deleted via the provider only and don't forget to delete disks manually if you deleted VM manually. It can increase spending.
     * 
     */
    @Import(name="deleteDataDisksOnTermination")
    private @Nullable Output deleteDataDisksOnTermination;

    /**
     * @return Should the Data Disks (either the Managed Disks / VHD Blobs) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
     * 
     * > **Note:** This setting works when instance is deleted via the provider only and don't forget to delete disks manually if you deleted VM manually. It can increase spending.
     * 
     */
    public Optional> deleteDataDisksOnTermination() {
        return Optional.ofNullable(this.deleteDataDisksOnTermination);
    }

    /**
     * Should the OS Disk (either the Managed Disk / VHD Blob) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
     * 
     * > **Note:** This setting works when instance is deleted via the provider only and don't forget to delete disks manually if you deleted VM manually. It can increase spending.
     * 
     */
    @Import(name="deleteOsDiskOnTermination")
    private @Nullable Output deleteOsDiskOnTermination;

    /**
     * @return Should the OS Disk (either the Managed Disk / VHD Blob) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
     * 
     * > **Note:** This setting works when instance is deleted via the provider only and don't forget to delete disks manually if you deleted VM manually. It can increase spending.
     * 
     */
    public Optional> deleteOsDiskOnTermination() {
        return Optional.ofNullable(this.deleteOsDiskOnTermination);
    }

    /**
     * An `identity` block as defined below.
     * 
     */
    @Import(name="identity")
    private @Nullable Output identity;

    /**
     * @return An `identity` block as defined below.
     * 
     */
    public Optional> identity() {
        return Optional.ofNullable(this.identity);
    }

    /**
     * Specifies the BYOL Type for this Virtual Machine. This is only applicable to Windows Virtual Machines. Possible values are `Windows_Client` and `Windows_Server`.
     * 
     */
    @Import(name="licenseType")
    private @Nullable Output licenseType;

    /**
     * @return Specifies the BYOL Type for this Virtual Machine. This is only applicable to Windows Virtual Machines. Possible values are `Windows_Client` and `Windows_Server`.
     * 
     */
    public Optional> licenseType() {
        return Optional.ofNullable(this.licenseType);
    }

    /**
     * Specifies the Azure Region where the Virtual Machine exists. Changing this forces a new resource to be created.
     * 
     */
    @Import(name="location")
    private @Nullable Output location;

    /**
     * @return Specifies the Azure Region where the Virtual Machine exists. Changing this forces a new resource to be created.
     * 
     */
    public Optional> location() {
        return Optional.ofNullable(this.location);
    }

    /**
     * Specifies the name of the Virtual Machine. Changing this forces a new resource to be created.
     * 
     */
    @Import(name="name")
    private @Nullable Output name;

    /**
     * @return Specifies the name of the Virtual Machine. Changing this forces a new resource to be created.
     * 
     */
    public Optional> name() {
        return Optional.ofNullable(this.name);
    }

    /**
     * A list of Network Interface IDs which should be associated with the Virtual Machine.
     * 
     */
    @Import(name="networkInterfaceIds", required=true)
    private Output> networkInterfaceIds;

    /**
     * @return A list of Network Interface IDs which should be associated with the Virtual Machine.
     * 
     */
    public Output> networkInterfaceIds() {
        return this.networkInterfaceIds;
    }

    /**
     * An `os_profile` block as defined below. Required when `create_option` in the `storage_os_disk` block is set to `FromImage`.
     * 
     */
    @Import(name="osProfile")
    private @Nullable Output osProfile;

    /**
     * @return An `os_profile` block as defined below. Required when `create_option` in the `storage_os_disk` block is set to `FromImage`.
     * 
     */
    public Optional> osProfile() {
        return Optional.ofNullable(this.osProfile);
    }

    /**
     * (Required, when a Linux machine) An `os_profile_linux_config` block as defined below.
     * 
     */
    @Import(name="osProfileLinuxConfig")
    private @Nullable Output osProfileLinuxConfig;

    /**
     * @return (Required, when a Linux machine) An `os_profile_linux_config` block as defined below.
     * 
     */
    public Optional> osProfileLinuxConfig() {
        return Optional.ofNullable(this.osProfileLinuxConfig);
    }

    /**
     * One or more `os_profile_secrets` blocks as defined below.
     * 
     */
    @Import(name="osProfileSecrets")
    private @Nullable Output> osProfileSecrets;

    /**
     * @return One or more `os_profile_secrets` blocks as defined below.
     * 
     */
    public Optional>> osProfileSecrets() {
        return Optional.ofNullable(this.osProfileSecrets);
    }

    /**
     * (Required, when a Windows machine) An `os_profile_windows_config` block as defined below.
     * 
     */
    @Import(name="osProfileWindowsConfig")
    private @Nullable Output osProfileWindowsConfig;

    /**
     * @return (Required, when a Windows machine) An `os_profile_windows_config` block as defined below.
     * 
     */
    public Optional> osProfileWindowsConfig() {
        return Optional.ofNullable(this.osProfileWindowsConfig);
    }

    /**
     * A `plan` block as defined below.
     * 
     */
    @Import(name="plan")
    private @Nullable Output plan;

    /**
     * @return A `plan` block as defined below.
     * 
     */
    public Optional> plan() {
        return Optional.ofNullable(this.plan);
    }

    /**
     * The ID of the Network Interface (which must be attached to the Virtual Machine) which should be the Primary Network Interface for this Virtual Machine.
     * 
     */
    @Import(name="primaryNetworkInterfaceId")
    private @Nullable Output primaryNetworkInterfaceId;

    /**
     * @return The ID of the Network Interface (which must be attached to the Virtual Machine) which should be the Primary Network Interface for this Virtual Machine.
     * 
     */
    public Optional> primaryNetworkInterfaceId() {
        return Optional.ofNullable(this.primaryNetworkInterfaceId);
    }

    /**
     * The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created
     * 
     */
    @Import(name="proximityPlacementGroupId")
    private @Nullable Output proximityPlacementGroupId;

    /**
     * @return The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created
     * 
     */
    public Optional> proximityPlacementGroupId() {
        return Optional.ofNullable(this.proximityPlacementGroupId);
    }

    /**
     * Specifies the name of the Resource Group in which the Virtual Machine should exist. Changing this forces a new resource to be created.
     * 
     */
    @Import(name="resourceGroupName", required=true)
    private Output resourceGroupName;

    /**
     * @return Specifies the name of the Resource Group in which the Virtual Machine should exist. Changing this forces a new resource to be created.
     * 
     */
    public Output resourceGroupName() {
        return this.resourceGroupName;
    }

    /**
     * One or more `storage_data_disk` blocks as defined below.
     * 
     * > **Please Note:** Data Disks can also be attached either using this block or the `azure.compute.DataDiskAttachment` resource - but not both.
     * 
     */
    @Import(name="storageDataDisks")
    private @Nullable Output> storageDataDisks;

    /**
     * @return One or more `storage_data_disk` blocks as defined below.
     * 
     * > **Please Note:** Data Disks can also be attached either using this block or the `azure.compute.DataDiskAttachment` resource - but not both.
     * 
     */
    public Optional>> storageDataDisks() {
        return Optional.ofNullable(this.storageDataDisks);
    }

    /**
     * A `storage_image_reference` block as defined below. Changing this forces a new resource to be created.
     * 
     */
    @Import(name="storageImageReference")
    private @Nullable Output storageImageReference;

    /**
     * @return A `storage_image_reference` block as defined below. Changing this forces a new resource to be created.
     * 
     */
    public Optional> storageImageReference() {
        return Optional.ofNullable(this.storageImageReference);
    }

    /**
     * A `storage_os_disk` block as defined below.
     * 
     */
    @Import(name="storageOsDisk", required=true)
    private Output storageOsDisk;

    /**
     * @return A `storage_os_disk` block as defined below.
     * 
     */
    public Output storageOsDisk() {
        return this.storageOsDisk;
    }

    /**
     * A mapping of tags to assign to the Virtual Machine.
     * 
     */
    @Import(name="tags")
    private @Nullable Output> tags;

    /**
     * @return A mapping of tags to assign to the Virtual Machine.
     * 
     */
    public Optional>> tags() {
        return Optional.ofNullable(this.tags);
    }

    /**
     * Specifies the [size of the Virtual Machine](https://docs.microsoft.com/azure/virtual-machines/sizes-general). See also [Azure VM Naming Conventions](https://docs.microsoft.com/azure/virtual-machines/vm-naming-conventions).
     * 
     */
    @Import(name="vmSize", required=true)
    private Output vmSize;

    /**
     * @return Specifies the [size of the Virtual Machine](https://docs.microsoft.com/azure/virtual-machines/sizes-general). See also [Azure VM Naming Conventions](https://docs.microsoft.com/azure/virtual-machines/vm-naming-conventions).
     * 
     */
    public Output vmSize() {
        return this.vmSize;
    }

    /**
     * A list of a single item of the Availability Zone which the Virtual Machine should be allocated in. Changing this forces a new resource to be created.
     * 
     * > **Please Note**: Availability Zones are [only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview).
     * 
     * For more information on the different example configurations, please check out the [Azure documentation](https://docs.microsoft.com/en-gb/rest/api/compute/virtualmachines/createorupdate#examples)
     * 
     */
    @Import(name="zones")
    private @Nullable Output zones;

    /**
     * @return A list of a single item of the Availability Zone which the Virtual Machine should be allocated in. Changing this forces a new resource to be created.
     * 
     * > **Please Note**: Availability Zones are [only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview).
     * 
     * For more information on the different example configurations, please check out the [Azure documentation](https://docs.microsoft.com/en-gb/rest/api/compute/virtualmachines/createorupdate#examples)
     * 
     */
    public Optional> zones() {
        return Optional.ofNullable(this.zones);
    }

    private VirtualMachineArgs() {}

    private VirtualMachineArgs(VirtualMachineArgs $) {
        this.additionalCapabilities = $.additionalCapabilities;
        this.availabilitySetId = $.availabilitySetId;
        this.bootDiagnostics = $.bootDiagnostics;
        this.deleteDataDisksOnTermination = $.deleteDataDisksOnTermination;
        this.deleteOsDiskOnTermination = $.deleteOsDiskOnTermination;
        this.identity = $.identity;
        this.licenseType = $.licenseType;
        this.location = $.location;
        this.name = $.name;
        this.networkInterfaceIds = $.networkInterfaceIds;
        this.osProfile = $.osProfile;
        this.osProfileLinuxConfig = $.osProfileLinuxConfig;
        this.osProfileSecrets = $.osProfileSecrets;
        this.osProfileWindowsConfig = $.osProfileWindowsConfig;
        this.plan = $.plan;
        this.primaryNetworkInterfaceId = $.primaryNetworkInterfaceId;
        this.proximityPlacementGroupId = $.proximityPlacementGroupId;
        this.resourceGroupName = $.resourceGroupName;
        this.storageDataDisks = $.storageDataDisks;
        this.storageImageReference = $.storageImageReference;
        this.storageOsDisk = $.storageOsDisk;
        this.tags = $.tags;
        this.vmSize = $.vmSize;
        this.zones = $.zones;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(VirtualMachineArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private VirtualMachineArgs $;

        public Builder() {
            $ = new VirtualMachineArgs();
        }

        public Builder(VirtualMachineArgs defaults) {
            $ = new VirtualMachineArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param additionalCapabilities An `additional_capabilities` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder additionalCapabilities(@Nullable Output additionalCapabilities) {
            $.additionalCapabilities = additionalCapabilities;
            return this;
        }

        /**
         * @param additionalCapabilities An `additional_capabilities` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder additionalCapabilities(VirtualMachineAdditionalCapabilitiesArgs additionalCapabilities) {
            return additionalCapabilities(Output.of(additionalCapabilities));
        }

        /**
         * @param availabilitySetId The ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder availabilitySetId(@Nullable Output availabilitySetId) {
            $.availabilitySetId = availabilitySetId;
            return this;
        }

        /**
         * @param availabilitySetId The ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder availabilitySetId(String availabilitySetId) {
            return availabilitySetId(Output.of(availabilitySetId));
        }

        /**
         * @param bootDiagnostics A `boot_diagnostics` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder bootDiagnostics(@Nullable Output bootDiagnostics) {
            $.bootDiagnostics = bootDiagnostics;
            return this;
        }

        /**
         * @param bootDiagnostics A `boot_diagnostics` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder bootDiagnostics(VirtualMachineBootDiagnosticsArgs bootDiagnostics) {
            return bootDiagnostics(Output.of(bootDiagnostics));
        }

        /**
         * @param deleteDataDisksOnTermination Should the Data Disks (either the Managed Disks / VHD Blobs) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
         * 
         * > **Note:** This setting works when instance is deleted via the provider only and don't forget to delete disks manually if you deleted VM manually. It can increase spending.
         * 
         * @return builder
         * 
         */
        public Builder deleteDataDisksOnTermination(@Nullable Output deleteDataDisksOnTermination) {
            $.deleteDataDisksOnTermination = deleteDataDisksOnTermination;
            return this;
        }

        /**
         * @param deleteDataDisksOnTermination Should the Data Disks (either the Managed Disks / VHD Blobs) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
         * 
         * > **Note:** This setting works when instance is deleted via the provider only and don't forget to delete disks manually if you deleted VM manually. It can increase spending.
         * 
         * @return builder
         * 
         */
        public Builder deleteDataDisksOnTermination(Boolean deleteDataDisksOnTermination) {
            return deleteDataDisksOnTermination(Output.of(deleteDataDisksOnTermination));
        }

        /**
         * @param deleteOsDiskOnTermination Should the OS Disk (either the Managed Disk / VHD Blob) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
         * 
         * > **Note:** This setting works when instance is deleted via the provider only and don't forget to delete disks manually if you deleted VM manually. It can increase spending.
         * 
         * @return builder
         * 
         */
        public Builder deleteOsDiskOnTermination(@Nullable Output deleteOsDiskOnTermination) {
            $.deleteOsDiskOnTermination = deleteOsDiskOnTermination;
            return this;
        }

        /**
         * @param deleteOsDiskOnTermination Should the OS Disk (either the Managed Disk / VHD Blob) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
         * 
         * > **Note:** This setting works when instance is deleted via the provider only and don't forget to delete disks manually if you deleted VM manually. It can increase spending.
         * 
         * @return builder
         * 
         */
        public Builder deleteOsDiskOnTermination(Boolean deleteOsDiskOnTermination) {
            return deleteOsDiskOnTermination(Output.of(deleteOsDiskOnTermination));
        }

        /**
         * @param identity An `identity` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder identity(@Nullable Output identity) {
            $.identity = identity;
            return this;
        }

        /**
         * @param identity An `identity` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder identity(VirtualMachineIdentityArgs identity) {
            return identity(Output.of(identity));
        }

        /**
         * @param licenseType Specifies the BYOL Type for this Virtual Machine. This is only applicable to Windows Virtual Machines. Possible values are `Windows_Client` and `Windows_Server`.
         * 
         * @return builder
         * 
         */
        public Builder licenseType(@Nullable Output licenseType) {
            $.licenseType = licenseType;
            return this;
        }

        /**
         * @param licenseType Specifies the BYOL Type for this Virtual Machine. This is only applicable to Windows Virtual Machines. Possible values are `Windows_Client` and `Windows_Server`.
         * 
         * @return builder
         * 
         */
        public Builder licenseType(String licenseType) {
            return licenseType(Output.of(licenseType));
        }

        /**
         * @param location Specifies the Azure Region where the Virtual Machine exists. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder location(@Nullable Output location) {
            $.location = location;
            return this;
        }

        /**
         * @param location Specifies the Azure Region where the Virtual Machine exists. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder location(String location) {
            return location(Output.of(location));
        }

        /**
         * @param name Specifies the name of the Virtual Machine. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder name(@Nullable Output name) {
            $.name = name;
            return this;
        }

        /**
         * @param name Specifies the name of the Virtual Machine. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        /**
         * @param networkInterfaceIds A list of Network Interface IDs which should be associated with the Virtual Machine.
         * 
         * @return builder
         * 
         */
        public Builder networkInterfaceIds(Output> networkInterfaceIds) {
            $.networkInterfaceIds = networkInterfaceIds;
            return this;
        }

        /**
         * @param networkInterfaceIds A list of Network Interface IDs which should be associated with the Virtual Machine.
         * 
         * @return builder
         * 
         */
        public Builder networkInterfaceIds(List networkInterfaceIds) {
            return networkInterfaceIds(Output.of(networkInterfaceIds));
        }

        /**
         * @param networkInterfaceIds A list of Network Interface IDs which should be associated with the Virtual Machine.
         * 
         * @return builder
         * 
         */
        public Builder networkInterfaceIds(String... networkInterfaceIds) {
            return networkInterfaceIds(List.of(networkInterfaceIds));
        }

        /**
         * @param osProfile An `os_profile` block as defined below. Required when `create_option` in the `storage_os_disk` block is set to `FromImage`.
         * 
         * @return builder
         * 
         */
        public Builder osProfile(@Nullable Output osProfile) {
            $.osProfile = osProfile;
            return this;
        }

        /**
         * @param osProfile An `os_profile` block as defined below. Required when `create_option` in the `storage_os_disk` block is set to `FromImage`.
         * 
         * @return builder
         * 
         */
        public Builder osProfile(VirtualMachineOsProfileArgs osProfile) {
            return osProfile(Output.of(osProfile));
        }

        /**
         * @param osProfileLinuxConfig (Required, when a Linux machine) An `os_profile_linux_config` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder osProfileLinuxConfig(@Nullable Output osProfileLinuxConfig) {
            $.osProfileLinuxConfig = osProfileLinuxConfig;
            return this;
        }

        /**
         * @param osProfileLinuxConfig (Required, when a Linux machine) An `os_profile_linux_config` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder osProfileLinuxConfig(VirtualMachineOsProfileLinuxConfigArgs osProfileLinuxConfig) {
            return osProfileLinuxConfig(Output.of(osProfileLinuxConfig));
        }

        /**
         * @param osProfileSecrets One or more `os_profile_secrets` blocks as defined below.
         * 
         * @return builder
         * 
         */
        public Builder osProfileSecrets(@Nullable Output> osProfileSecrets) {
            $.osProfileSecrets = osProfileSecrets;
            return this;
        }

        /**
         * @param osProfileSecrets One or more `os_profile_secrets` blocks as defined below.
         * 
         * @return builder
         * 
         */
        public Builder osProfileSecrets(List osProfileSecrets) {
            return osProfileSecrets(Output.of(osProfileSecrets));
        }

        /**
         * @param osProfileSecrets One or more `os_profile_secrets` blocks as defined below.
         * 
         * @return builder
         * 
         */
        public Builder osProfileSecrets(VirtualMachineOsProfileSecretArgs... osProfileSecrets) {
            return osProfileSecrets(List.of(osProfileSecrets));
        }

        /**
         * @param osProfileWindowsConfig (Required, when a Windows machine) An `os_profile_windows_config` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder osProfileWindowsConfig(@Nullable Output osProfileWindowsConfig) {
            $.osProfileWindowsConfig = osProfileWindowsConfig;
            return this;
        }

        /**
         * @param osProfileWindowsConfig (Required, when a Windows machine) An `os_profile_windows_config` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder osProfileWindowsConfig(VirtualMachineOsProfileWindowsConfigArgs osProfileWindowsConfig) {
            return osProfileWindowsConfig(Output.of(osProfileWindowsConfig));
        }

        /**
         * @param plan A `plan` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder plan(@Nullable Output plan) {
            $.plan = plan;
            return this;
        }

        /**
         * @param plan A `plan` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder plan(VirtualMachinePlanArgs plan) {
            return plan(Output.of(plan));
        }

        /**
         * @param primaryNetworkInterfaceId The ID of the Network Interface (which must be attached to the Virtual Machine) which should be the Primary Network Interface for this Virtual Machine.
         * 
         * @return builder
         * 
         */
        public Builder primaryNetworkInterfaceId(@Nullable Output primaryNetworkInterfaceId) {
            $.primaryNetworkInterfaceId = primaryNetworkInterfaceId;
            return this;
        }

        /**
         * @param primaryNetworkInterfaceId The ID of the Network Interface (which must be attached to the Virtual Machine) which should be the Primary Network Interface for this Virtual Machine.
         * 
         * @return builder
         * 
         */
        public Builder primaryNetworkInterfaceId(String primaryNetworkInterfaceId) {
            return primaryNetworkInterfaceId(Output.of(primaryNetworkInterfaceId));
        }

        /**
         * @param proximityPlacementGroupId The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created
         * 
         * @return builder
         * 
         */
        public Builder proximityPlacementGroupId(@Nullable Output proximityPlacementGroupId) {
            $.proximityPlacementGroupId = proximityPlacementGroupId;
            return this;
        }

        /**
         * @param proximityPlacementGroupId The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created
         * 
         * @return builder
         * 
         */
        public Builder proximityPlacementGroupId(String proximityPlacementGroupId) {
            return proximityPlacementGroupId(Output.of(proximityPlacementGroupId));
        }

        /**
         * @param resourceGroupName Specifies the name of the Resource Group in which the Virtual Machine should exist. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder resourceGroupName(Output resourceGroupName) {
            $.resourceGroupName = resourceGroupName;
            return this;
        }

        /**
         * @param resourceGroupName Specifies the name of the Resource Group in which the Virtual Machine should exist. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder resourceGroupName(String resourceGroupName) {
            return resourceGroupName(Output.of(resourceGroupName));
        }

        /**
         * @param storageDataDisks One or more `storage_data_disk` blocks as defined below.
         * 
         * > **Please Note:** Data Disks can also be attached either using this block or the `azure.compute.DataDiskAttachment` resource - but not both.
         * 
         * @return builder
         * 
         */
        public Builder storageDataDisks(@Nullable Output> storageDataDisks) {
            $.storageDataDisks = storageDataDisks;
            return this;
        }

        /**
         * @param storageDataDisks One or more `storage_data_disk` blocks as defined below.
         * 
         * > **Please Note:** Data Disks can also be attached either using this block or the `azure.compute.DataDiskAttachment` resource - but not both.
         * 
         * @return builder
         * 
         */
        public Builder storageDataDisks(List storageDataDisks) {
            return storageDataDisks(Output.of(storageDataDisks));
        }

        /**
         * @param storageDataDisks One or more `storage_data_disk` blocks as defined below.
         * 
         * > **Please Note:** Data Disks can also be attached either using this block or the `azure.compute.DataDiskAttachment` resource - but not both.
         * 
         * @return builder
         * 
         */
        public Builder storageDataDisks(VirtualMachineStorageDataDiskArgs... storageDataDisks) {
            return storageDataDisks(List.of(storageDataDisks));
        }

        /**
         * @param storageImageReference A `storage_image_reference` block as defined below. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder storageImageReference(@Nullable Output storageImageReference) {
            $.storageImageReference = storageImageReference;
            return this;
        }

        /**
         * @param storageImageReference A `storage_image_reference` block as defined below. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder storageImageReference(VirtualMachineStorageImageReferenceArgs storageImageReference) {
            return storageImageReference(Output.of(storageImageReference));
        }

        /**
         * @param storageOsDisk A `storage_os_disk` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder storageOsDisk(Output storageOsDisk) {
            $.storageOsDisk = storageOsDisk;
            return this;
        }

        /**
         * @param storageOsDisk A `storage_os_disk` block as defined below.
         * 
         * @return builder
         * 
         */
        public Builder storageOsDisk(VirtualMachineStorageOsDiskArgs storageOsDisk) {
            return storageOsDisk(Output.of(storageOsDisk));
        }

        /**
         * @param tags A mapping of tags to assign to the Virtual Machine.
         * 
         * @return builder
         * 
         */
        public Builder tags(@Nullable Output> tags) {
            $.tags = tags;
            return this;
        }

        /**
         * @param tags A mapping of tags to assign to the Virtual Machine.
         * 
         * @return builder
         * 
         */
        public Builder tags(Map tags) {
            return tags(Output.of(tags));
        }

        /**
         * @param vmSize Specifies the [size of the Virtual Machine](https://docs.microsoft.com/azure/virtual-machines/sizes-general). See also [Azure VM Naming Conventions](https://docs.microsoft.com/azure/virtual-machines/vm-naming-conventions).
         * 
         * @return builder
         * 
         */
        public Builder vmSize(Output vmSize) {
            $.vmSize = vmSize;
            return this;
        }

        /**
         * @param vmSize Specifies the [size of the Virtual Machine](https://docs.microsoft.com/azure/virtual-machines/sizes-general). See also [Azure VM Naming Conventions](https://docs.microsoft.com/azure/virtual-machines/vm-naming-conventions).
         * 
         * @return builder
         * 
         */
        public Builder vmSize(String vmSize) {
            return vmSize(Output.of(vmSize));
        }

        /**
         * @param zones A list of a single item of the Availability Zone which the Virtual Machine should be allocated in. Changing this forces a new resource to be created.
         * 
         * > **Please Note**: Availability Zones are [only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview).
         * 
         * For more information on the different example configurations, please check out the [Azure documentation](https://docs.microsoft.com/en-gb/rest/api/compute/virtualmachines/createorupdate#examples)
         * 
         * @return builder
         * 
         */
        public Builder zones(@Nullable Output zones) {
            $.zones = zones;
            return this;
        }

        /**
         * @param zones A list of a single item of the Availability Zone which the Virtual Machine should be allocated in. Changing this forces a new resource to be created.
         * 
         * > **Please Note**: Availability Zones are [only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview).
         * 
         * For more information on the different example configurations, please check out the [Azure documentation](https://docs.microsoft.com/en-gb/rest/api/compute/virtualmachines/createorupdate#examples)
         * 
         * @return builder
         * 
         */
        public Builder zones(String zones) {
            return zones(Output.of(zones));
        }

        public VirtualMachineArgs build() {
            if ($.networkInterfaceIds == null) {
                throw new MissingRequiredPropertyException("VirtualMachineArgs", "networkInterfaceIds");
            }
            if ($.resourceGroupName == null) {
                throw new MissingRequiredPropertyException("VirtualMachineArgs", "resourceGroupName");
            }
            if ($.storageOsDisk == null) {
                throw new MissingRequiredPropertyException("VirtualMachineArgs", "storageOsDisk");
            }
            if ($.vmSize == null) {
                throw new MissingRequiredPropertyException("VirtualMachineArgs", "vmSize");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy