# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables


class VirtualMachine(pulumi.CustomResource):
    additional_capabilities: pulumi.Output[dict]
    """
    A `additional_capabilities` block.

      * `ultraSsdEnabled` (`bool`) - Should Ultra SSD disk be enabled for this Virtual Machine?
    """
    availability_set_id: pulumi.Output[str]
    """
    The ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created.
    """
    boot_diagnostics: pulumi.Output[dict]
    """
    A `boot_diagnostics` block.

      * `enabled` (`bool`) - Should Boot Diagnostics be enabled for this Virtual Machine?
      * `storageUri` (`str`) - The Storage Account's Blob Endpoint which should hold the virtual machine's diagnostic files.
    """
    delete_data_disks_on_termination: pulumi.Output[bool]
    """
    Should the Data Disks (either the Managed Disks / VHD Blobs) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
    """
    delete_os_disk_on_termination: pulumi.Output[bool]
    """
    Should the OS Disk (either the Managed Disk / VHD Blob) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
    """
    identity: pulumi.Output[dict]
    """
    A `identity` block.

      * `identityIds` (`list`) - Specifies a list of user managed identity ids to be assigned to the VM. Required if `type` is `UserAssigned`.
      * `principal_id` (`str`) - The Principal ID for the Service Principal associated with the Managed Service Identity of this Virtual Machine.
      * `type` (`str`) - The Managed Service Identity Type of this Virtual Machine. Possible values are `SystemAssigned` (where Azure will generate a Service Principal for you), `UserAssigned` (where you can specify the Service Principal ID's) to be used by this Virtual Machine using the `identity_ids` field, and `SystemAssigned, UserAssigned` which assigns both a system managed identity as well as the specified user assigned identities.
    """
    license_type: pulumi.Output[str]
    """
    Specifies the BYOL Type for this Virtual Machine. This is only applicable to Windows Virtual Machines. Possible values are `Windows_Client` and `Windows_Server`.
    """
    location: pulumi.Output[str]
    """
    Specifies the Azure Region where the Virtual Machine exists. Changing this forces a new resource to be created.
    """
    name: pulumi.Output[str]
    """
    Specifies the name of the Virtual Machine. Changing this forces a new resource to be created.
    """
    network_interface_ids: pulumi.Output[list]
    """
    A list of Network Interface ID's which should be associated with the Virtual Machine.
    """
    os_profile: pulumi.Output[dict]
    """
    An `os_profile` block. Required when `create_option` in the `storage_os_disk` block is set to `FromImage`.

      * `admin_password` (`str`) - The password associated with the local administrator account.
      * `admin_username` (`str`) - Specifies the name of the local administrator account.
      * `computer_name` (`str`) - Specifies the name of the Virtual Machine.
      * `custom_data` (`str`) - Specifies custom data to supply to the machine. On Linux-based systems, this can be used as a cloud-init script. On other systems, this will be copied as a file on disk. Internally, this provider will base64 encode this value before sending it to the API. The maximum length of the binary array is 65535 bytes.
    """
    os_profile_linux_config: pulumi.Output[dict]
    """
    A `os_profile_linux_config` block.

      * `disable_password_authentication` (`bool`) - Specifies whether password authentication should be disabled. If set to `false`, an `admin_password` must be specified.
      * `sshKeys` (`list`) - One or more `ssh_keys` blocks. This field is required if `disable_password_authentication` is set to `true`.
        * `keyData` (`str`) - The Public SSH Key which should be written to the `path` defined above.
        * `path` (`str`) - The path of the destination file on the virtual machine
    """
    os_profile_secrets: pulumi.Output[list]
    """
    One or more `os_profile_secrets` blocks.

      * `sourceVaultId` (`str`) - Specifies the ID of the Key Vault to use.
      * `vaultCertificates` (`list`) - One or more `vault_certificates` blocks.
        * `certificateStore` (`str`) - Specifies the certificate store on the Virtual Machine where the certificate should be added to, such as `My`.
        * `certificateUrl` (`str`) - The ID of the Key Vault Secret. Stored secret is the Base64 encoding of a JSON Object that which is encoded in UTF-8 of which the contents need to be:
    """
    os_profile_windows_config: pulumi.Output[dict]
    """
    A `os_profile_windows_config` block.

      * `additionalUnattendConfigs` (`list`) - A `additional_unattend_config` block.
        * `component` (`str`) - Specifies the name of the component to configure with the added content. The only allowable value is `Microsoft-Windows-Shell-Setup`.
        * `content` (`str`) - Specifies the base-64 encoded XML formatted content that is added to the unattend.xml file for the specified path and component.
        * `pass` (`str`) - Specifies the name of the pass that the content applies to. The only allowable value is `oobeSystem`.
        * `settingName` (`str`) - Specifies the name of the setting to which the content applies. Possible values are: `FirstLogonCommands` and `AutoLogon`.

      * `enableAutomaticUpgrades` (`bool`) - Are automatic updates enabled on this Virtual Machine? Defaults to `false.`
      * `provision_vm_agent` (`bool`) - Should the Azure Virtual Machine Guest Agent be installed on this Virtual Machine? Defaults to `false`.
      * `timezone` (`str`) - Specifies the time zone of the virtual machine, [the possible values are defined here](http://jackstromberg.com/2017/01/list-of-time-zones-consumed-by-azure/).
      * `winrms` (`list`) - One or more `winrm` block.
        * `certificateUrl` (`str`) - The ID of the Key Vault Secret which contains the encrypted Certificate which should be installed on the Virtual Machine. This certificate must also be specified in the `vault_certificates` block within the `os_profile_secrets` block.
        * `protocol` (`str`) - Specifies the protocol of listener. Possible values are `HTTP` or `HTTPS`.
    """
    plan: pulumi.Output[dict]
    """
    A `plan` block.

      * `name` (`str`) - Specifies the name of the image from the marketplace.
      * `product` (`str`) - Specifies the product of the image from the marketplace.
      * `publisher` (`str`) - Specifies the publisher of the image.
    """
    primary_network_interface_id: pulumi.Output[str]
    """
    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.
    """
    proximity_placement_group_id: pulumi.Output[str]
    """
    The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created
    """
    resource_group_name: pulumi.Output[str]
    """
    Specifies the name of the Resource Group in which the Virtual Machine should exist. Changing this forces a new resource to be created.
    """
    storage_data_disks: pulumi.Output[list]
    """
    One or more `storage_data_disk` blocks.

      * `caching` (`str`) - Specifies the caching requirements for the Data Disk. Possible values include `None`, `ReadOnly` and `ReadWrite`.
      * `create_option` (`str`) - Specifies how the data disk should be created. Possible values are `Attach`, `FromImage` and `Empty`.
      * `disk_size_gb` (`float`) - Specifies the size of the data disk in gigabytes.
      * `lun` (`float`) - Specifies the logical unit number of the data disk. This needs to be unique within all the Data Disks on the Virtual Machine.
      * `managed_disk_id` (`str`) - Specifies the ID of an Existing Managed Disk which should be attached to this Virtual Machine. When this field is set `create_option` must be set to `Attach`.
      * `managedDiskType` (`str`) - Specifies the type of managed disk to create. Possible values are either `Standard_LRS`, `StandardSSD_LRS`, `Premium_LRS` or `UltraSSD_LRS`.
      * `name` (`str`) - The name of the Data Disk.
      * `vhdUri` (`str`) - Specifies the URI of the VHD file backing this Unmanaged Data Disk. Changing this forces a new resource to be created.
      * `write_accelerator_enabled` (`bool`) - Specifies if Write Accelerator is enabled on the disk. This can only be enabled on `Premium_LRS` managed disks with no caching and [M-Series VMs](https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/how-to-enable-write-accelerator). Defaults to `false`.
    """
    storage_image_reference: pulumi.Output[dict]
    """
    A `storage_image_reference` block.

      * `id` (`str`) - Specifies the ID of the Custom Image which the Virtual Machine should be created from. Changing this forces a new resource to be created.
      * `offer` (`str`) - Specifies the offer of the image used to create the virtual machine. Changing this forces a new resource to be created.
      * `publisher` (`str`) - Specifies the publisher of the image used to create the virtual machine. Changing this forces a new resource to be created.
      * `sku` (`str`) - Specifies the SKU of the image used to create the virtual machine. Changing this forces a new resource to be created.
      * `version` (`str`) - Specifies the version of the image used to create the virtual machine. Changing this forces a new resource to be created.
    """
    storage_os_disk: pulumi.Output[dict]
    """
    A `storage_os_disk` block.

      * `caching` (`str`) - Specifies the caching requirements for the OS Disk. Possible values include `None`, `ReadOnly` and `ReadWrite`.
      * `create_option` (`str`) - Specifies how the OS Disk should be created. Possible values are `Attach` (managed disks only) and `FromImage`.
      * `disk_size_gb` (`float`) - Specifies the size of the OS Disk in gigabytes.
      * `imageUri` (`str`) - Specifies the Image URI in the format `publisherName:offer:skus:version`. This field can also specify the [VHD uri](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-cli-deploy-templates/#create-a-custom-vm-image) of a custom VM image to clone. When cloning a Custom (Unmanaged) Disk Image the `os_type` field must be set.
      * `managed_disk_id` (`str`) - Specifies the ID of an existing Managed Disk which should be attached as the OS Disk of this Virtual Machine. If this is set then the `create_option` must be set to `Attach`.
      * `managedDiskType` (`str`) - Specifies the type of Managed Disk which should be created. Possible values are `Standard_LRS`, `StandardSSD_LRS` or `Premium_LRS`.
      * `name` (`str`) - Specifies the name of the OS Disk.
      * `os_type` (`str`) - Specifies the Operating System on the OS Disk. Possible values are `Linux` and `Windows`.
      * `vhdUri` (`str`) - Specifies the URI of the VHD file backing this Unmanaged OS Disk. Changing this forces a new resource to be created.
      * `write_accelerator_enabled` (`bool`) - Specifies if Write Accelerator is enabled on the disk. This can only be enabled on `Premium_LRS` managed disks with no caching and [M-Series VMs](https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/how-to-enable-write-accelerator). Defaults to `false`.
    """
    tags: pulumi.Output[dict]
    """
    A mapping of tags to assign to the Virtual Machine.
    """
    vm_size: pulumi.Output[str]
    """
    Specifies the [size of the Virtual Machine](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-size-specs/).
    """
    zones: pulumi.Output[str]
    """
    A list of a single item of the Availability Zone which the Virtual Machine should be allocated in.
    """
    def __init__(__self__, resource_name, opts=None, additional_capabilities=None, availability_set_id=None, boot_diagnostics=None, delete_data_disks_on_termination=None, delete_os_disk_on_termination=None, identity=None, license_type=None, location=None, name=None, network_interface_ids=None, os_profile=None, os_profile_linux_config=None, os_profile_secrets=None, os_profile_windows_config=None, plan=None, primary_network_interface_id=None, proximity_placement_group_id=None, resource_group_name=None, storage_data_disks=None, storage_image_reference=None, storage_os_disk=None, tags=None, vm_size=None, zones=None, __props__=None, __name__=None, __opts__=None):
        """
        Manages a Virtual Machine.

        ## Disclaimers

        > **Note:** The `compute.VirtualMachine` resource has been superseded by the `compute.LinuxVirtualMachine` and `compute.WindowsVirtualMachine` resources. The existing `compute.VirtualMachine` resource will continue to be available throughout the 2.x releases however is in a feature-frozen state to maintain compatibility - new functionality will instead be added to the `compute.LinuxVirtualMachine` and `compute.WindowsVirtualMachine` resources.

        > **Note:** Data Disks can be attached either directly on the `compute.VirtualMachine` resource, or using the `compute.DataDiskAttachment` resource - but the two cannot be used together. If both are used against the same Virtual Machine, spurious changes will occur.

        ## Example Usage
        ### From An Azure Platform Image)

        This example provisions a Virtual Machine with Managed Disks.

        ```python
        import pulumi
        import pulumi_azure as azure

        config = pulumi.Config()
        prefix = config.get("prefix")
        if prefix is None:
            prefix = "tfvmex"
        main_resource_group = azure.core.ResourceGroup("mainResourceGroup", location="West US 2")
        main_virtual_network = azure.network.VirtualNetwork("mainVirtualNetwork",
            address_spaces=["10.0.0.0/16"],
            location=main_resource_group.location,
            resource_group_name=main_resource_group.name)
        internal = azure.network.Subnet("internal",
            resource_group_name=main_resource_group.name,
            virtual_network_name=main_virtual_network.name,
            address_prefix="10.0.2.0/24")
        main_network_interface = azure.network.NetworkInterface("mainNetworkInterface",
            location=main_resource_group.location,
            resource_group_name=main_resource_group.name,
            ip_configurations=[{
                "name": "testconfiguration1",
                "subnet_id": internal.id,
                "privateIpAddressAllocation": "Dynamic",
            }])
        main_virtual_machine = azure.compute.VirtualMachine("mainVirtualMachine",
            location=main_resource_group.location,
            resource_group_name=main_resource_group.name,
            network_interface_ids=[main_network_interface.id],
            vm_size="Standard_DS1_v2",
            storage_image_reference={
                "publisher": "Canonical",
                "offer": "UbuntuServer",
                "sku": "16.04-LTS",
                "version": "latest",
            },
            storage_os_disk={
                "name": "myosdisk1",
                "caching": "ReadWrite",
                "create_option": "FromImage",
                "managedDiskType": "Standard_LRS",
            },
            os_profile={
                "computer_name": "hostname",
                "admin_username": "testadmin",
                "admin_password": "Password1234!",
            },
            os_profile_linux_config={
                "disable_password_authentication": False,
            },
            tags={
                "environment": "staging",
            })
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[dict] additional_capabilities: A `additional_capabilities` block.
        :param pulumi.Input[str] availability_set_id: The ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created.
        :param pulumi.Input[dict] boot_diagnostics: A `boot_diagnostics` block.
        :param pulumi.Input[bool] delete_data_disks_on_termination: Should the Data Disks (either the Managed Disks / VHD Blobs) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
        :param pulumi.Input[bool] delete_os_disk_on_termination: Should the OS Disk (either the Managed Disk / VHD Blob) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
        :param pulumi.Input[dict] identity: A `identity` block.
        :param pulumi.Input[str] license_type: Specifies the BYOL Type for this Virtual Machine. This is only applicable to Windows Virtual Machines. Possible values are `Windows_Client` and `Windows_Server`.
        :param pulumi.Input[str] location: Specifies the Azure Region where the Virtual Machine exists. Changing this forces a new resource to be created.
        :param pulumi.Input[str] name: Specifies the name of the Virtual Machine. Changing this forces a new resource to be created.
        :param pulumi.Input[list] network_interface_ids: A list of Network Interface ID's which should be associated with the Virtual Machine.
        :param pulumi.Input[dict] os_profile: An `os_profile` block. Required when `create_option` in the `storage_os_disk` block is set to `FromImage`.
        :param pulumi.Input[dict] os_profile_linux_config: A `os_profile_linux_config` block.
        :param pulumi.Input[list] os_profile_secrets: One or more `os_profile_secrets` blocks.
        :param pulumi.Input[dict] os_profile_windows_config: A `os_profile_windows_config` block.
        :param pulumi.Input[dict] plan: A `plan` block.
        :param pulumi.Input[str] primary_network_interface_id: 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.
        :param pulumi.Input[str] proximity_placement_group_id: The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created
        :param pulumi.Input[str] resource_group_name: Specifies the name of the Resource Group in which the Virtual Machine should exist. Changing this forces a new resource to be created.
        :param pulumi.Input[list] storage_data_disks: One or more `storage_data_disk` blocks.
        :param pulumi.Input[dict] storage_image_reference: A `storage_image_reference` block.
        :param pulumi.Input[dict] storage_os_disk: A `storage_os_disk` block.
        :param pulumi.Input[dict] tags: A mapping of tags to assign to the Virtual Machine.
        :param pulumi.Input[str] vm_size: Specifies the [size of the Virtual Machine](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-size-specs/).
        :param pulumi.Input[str] zones: A list of a single item of the Availability Zone which the Virtual Machine should be allocated in.

        The **additional_capabilities** object supports the following:

          * `ultraSsdEnabled` (`pulumi.Input[bool]`) - Should Ultra SSD disk be enabled for this Virtual Machine?

        The **boot_diagnostics** object supports the following:

          * `enabled` (`pulumi.Input[bool]`) - Should Boot Diagnostics be enabled for this Virtual Machine?
          * `storageUri` (`pulumi.Input[str]`) - The Storage Account's Blob Endpoint which should hold the virtual machine's diagnostic files.

        The **identity** object supports the following:

          * `identityIds` (`pulumi.Input[list]`) - Specifies a list of user managed identity ids to be assigned to the VM. Required if `type` is `UserAssigned`.
          * `principal_id` (`pulumi.Input[str]`) - The Principal ID for the Service Principal associated with the Managed Service Identity of this Virtual Machine.
          * `type` (`pulumi.Input[str]`) - The Managed Service Identity Type of this Virtual Machine. Possible values are `SystemAssigned` (where Azure will generate a Service Principal for you), `UserAssigned` (where you can specify the Service Principal ID's) to be used by this Virtual Machine using the `identity_ids` field, and `SystemAssigned, UserAssigned` which assigns both a system managed identity as well as the specified user assigned identities.

        The **os_profile** object supports the following:

          * `admin_password` (`pulumi.Input[str]`) - The password associated with the local administrator account.
          * `admin_username` (`pulumi.Input[str]`) - Specifies the name of the local administrator account.
          * `computer_name` (`pulumi.Input[str]`) - Specifies the name of the Virtual Machine.
          * `custom_data` (`pulumi.Input[str]`) - Specifies custom data to supply to the machine. On Linux-based systems, this can be used as a cloud-init script. On other systems, this will be copied as a file on disk. Internally, this provider will base64 encode this value before sending it to the API. The maximum length of the binary array is 65535 bytes.

        The **os_profile_linux_config** object supports the following:

          * `disable_password_authentication` (`pulumi.Input[bool]`) - Specifies whether password authentication should be disabled. If set to `false`, an `admin_password` must be specified.
          * `sshKeys` (`pulumi.Input[list]`) - One or more `ssh_keys` blocks. This field is required if `disable_password_authentication` is set to `true`.
            * `keyData` (`pulumi.Input[str]`) - The Public SSH Key which should be written to the `path` defined above.
            * `path` (`pulumi.Input[str]`) - The path of the destination file on the virtual machine

        The **os_profile_secrets** object supports the following:

          * `sourceVaultId` (`pulumi.Input[str]`) - Specifies the ID of the Key Vault to use.
          * `vaultCertificates` (`pulumi.Input[list]`) - One or more `vault_certificates` blocks.
            * `certificateStore` (`pulumi.Input[str]`) - Specifies the certificate store on the Virtual Machine where the certificate should be added to, such as `My`.
            * `certificateUrl` (`pulumi.Input[str]`) - The ID of the Key Vault Secret. Stored secret is the Base64 encoding of a JSON Object that which is encoded in UTF-8 of which the contents need to be:

        The **os_profile_windows_config** object supports the following:

          * `additionalUnattendConfigs` (`pulumi.Input[list]`) - A `additional_unattend_config` block.
            * `component` (`pulumi.Input[str]`) - Specifies the name of the component to configure with the added content. The only allowable value is `Microsoft-Windows-Shell-Setup`.
            * `content` (`pulumi.Input[str]`) - Specifies the base-64 encoded XML formatted content that is added to the unattend.xml file for the specified path and component.
            * `pass` (`pulumi.Input[str]`) - Specifies the name of the pass that the content applies to. The only allowable value is `oobeSystem`.
            * `settingName` (`pulumi.Input[str]`) - Specifies the name of the setting to which the content applies. Possible values are: `FirstLogonCommands` and `AutoLogon`.

          * `enableAutomaticUpgrades` (`pulumi.Input[bool]`) - Are automatic updates enabled on this Virtual Machine? Defaults to `false.`
          * `provision_vm_agent` (`pulumi.Input[bool]`) - Should the Azure Virtual Machine Guest Agent be installed on this Virtual Machine? Defaults to `false`.
          * `timezone` (`pulumi.Input[str]`) - Specifies the time zone of the virtual machine, [the possible values are defined here](http://jackstromberg.com/2017/01/list-of-time-zones-consumed-by-azure/).
          * `winrms` (`pulumi.Input[list]`) - One or more `winrm` block.
            * `certificateUrl` (`pulumi.Input[str]`) - The ID of the Key Vault Secret which contains the encrypted Certificate which should be installed on the Virtual Machine. This certificate must also be specified in the `vault_certificates` block within the `os_profile_secrets` block.
            * `protocol` (`pulumi.Input[str]`) - Specifies the protocol of listener. Possible values are `HTTP` or `HTTPS`.

        The **plan** object supports the following:

          * `name` (`pulumi.Input[str]`) - Specifies the name of the image from the marketplace.
          * `product` (`pulumi.Input[str]`) - Specifies the product of the image from the marketplace.
          * `publisher` (`pulumi.Input[str]`) - Specifies the publisher of the image.

        The **storage_data_disks** object supports the following:

          * `caching` (`pulumi.Input[str]`) - Specifies the caching requirements for the Data Disk. Possible values include `None`, `ReadOnly` and `ReadWrite`.
          * `create_option` (`pulumi.Input[str]`) - Specifies how the data disk should be created. Possible values are `Attach`, `FromImage` and `Empty`.
          * `disk_size_gb` (`pulumi.Input[float]`) - Specifies the size of the data disk in gigabytes.
          * `lun` (`pulumi.Input[float]`) - Specifies the logical unit number of the data disk. This needs to be unique within all the Data Disks on the Virtual Machine.
          * `managed_disk_id` (`pulumi.Input[str]`) - Specifies the ID of an Existing Managed Disk which should be attached to this Virtual Machine. When this field is set `create_option` must be set to `Attach`.
          * `managedDiskType` (`pulumi.Input[str]`) - Specifies the type of managed disk to create. Possible values are either `Standard_LRS`, `StandardSSD_LRS`, `Premium_LRS` or `UltraSSD_LRS`.
          * `name` (`pulumi.Input[str]`) - The name of the Data Disk.
          * `vhdUri` (`pulumi.Input[str]`) - Specifies the URI of the VHD file backing this Unmanaged Data Disk. Changing this forces a new resource to be created.
          * `write_accelerator_enabled` (`pulumi.Input[bool]`) - Specifies if Write Accelerator is enabled on the disk. This can only be enabled on `Premium_LRS` managed disks with no caching and [M-Series VMs](https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/how-to-enable-write-accelerator). Defaults to `false`.

        The **storage_image_reference** object supports the following:

          * `id` (`pulumi.Input[str]`) - Specifies the ID of the Custom Image which the Virtual Machine should be created from. Changing this forces a new resource to be created.
          * `offer` (`pulumi.Input[str]`) - Specifies the offer of the image used to create the virtual machine. Changing this forces a new resource to be created.
          * `publisher` (`pulumi.Input[str]`) - Specifies the publisher of the image used to create the virtual machine. Changing this forces a new resource to be created.
          * `sku` (`pulumi.Input[str]`) - Specifies the SKU of the image used to create the virtual machine. Changing this forces a new resource to be created.
          * `version` (`pulumi.Input[str]`) - Specifies the version of the image used to create the virtual machine. Changing this forces a new resource to be created.

        The **storage_os_disk** object supports the following:

          * `caching` (`pulumi.Input[str]`) - Specifies the caching requirements for the OS Disk. Possible values include `None`, `ReadOnly` and `ReadWrite`.
          * `create_option` (`pulumi.Input[str]`) - Specifies how the OS Disk should be created. Possible values are `Attach` (managed disks only) and `FromImage`.
          * `disk_size_gb` (`pulumi.Input[float]`) - Specifies the size of the OS Disk in gigabytes.
          * `imageUri` (`pulumi.Input[str]`) - Specifies the Image URI in the format `publisherName:offer:skus:version`. This field can also specify the [VHD uri](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-cli-deploy-templates/#create-a-custom-vm-image) of a custom VM image to clone. When cloning a Custom (Unmanaged) Disk Image the `os_type` field must be set.
          * `managed_disk_id` (`pulumi.Input[str]`) - Specifies the ID of an existing Managed Disk which should be attached as the OS Disk of this Virtual Machine. If this is set then the `create_option` must be set to `Attach`.
          * `managedDiskType` (`pulumi.Input[str]`) - Specifies the type of Managed Disk which should be created. Possible values are `Standard_LRS`, `StandardSSD_LRS` or `Premium_LRS`.
          * `name` (`pulumi.Input[str]`) - Specifies the name of the OS Disk.
          * `os_type` (`pulumi.Input[str]`) - Specifies the Operating System on the OS Disk. Possible values are `Linux` and `Windows`.
          * `vhdUri` (`pulumi.Input[str]`) - Specifies the URI of the VHD file backing this Unmanaged OS Disk. Changing this forces a new resource to be created.
          * `write_accelerator_enabled` (`pulumi.Input[bool]`) - Specifies if Write Accelerator is enabled on the disk. This can only be enabled on `Premium_LRS` managed disks with no caching and [M-Series VMs](https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/how-to-enable-write-accelerator). Defaults to `false`.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = utilities.get_version()
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = dict()

            __props__['additional_capabilities'] = additional_capabilities
            __props__['availability_set_id'] = availability_set_id
            __props__['boot_diagnostics'] = boot_diagnostics
            __props__['delete_data_disks_on_termination'] = delete_data_disks_on_termination
            __props__['delete_os_disk_on_termination'] = delete_os_disk_on_termination
            __props__['identity'] = identity
            __props__['license_type'] = license_type
            __props__['location'] = location
            __props__['name'] = name
            if network_interface_ids is None:
                raise TypeError("Missing required property 'network_interface_ids'")
            __props__['network_interface_ids'] = network_interface_ids
            __props__['os_profile'] = os_profile
            __props__['os_profile_linux_config'] = os_profile_linux_config
            __props__['os_profile_secrets'] = os_profile_secrets
            __props__['os_profile_windows_config'] = os_profile_windows_config
            __props__['plan'] = plan
            __props__['primary_network_interface_id'] = primary_network_interface_id
            __props__['proximity_placement_group_id'] = proximity_placement_group_id
            if resource_group_name is None:
                raise TypeError("Missing required property 'resource_group_name'")
            __props__['resource_group_name'] = resource_group_name
            __props__['storage_data_disks'] = storage_data_disks
            __props__['storage_image_reference'] = storage_image_reference
            if storage_os_disk is None:
                raise TypeError("Missing required property 'storage_os_disk'")
            __props__['storage_os_disk'] = storage_os_disk
            __props__['tags'] = tags
            if vm_size is None:
                raise TypeError("Missing required property 'vm_size'")
            __props__['vm_size'] = vm_size
            __props__['zones'] = zones
        super(VirtualMachine, __self__).__init__(
            'azure:compute/virtualMachine:VirtualMachine',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, additional_capabilities=None, availability_set_id=None, boot_diagnostics=None, delete_data_disks_on_termination=None, delete_os_disk_on_termination=None, identity=None, license_type=None, location=None, name=None, network_interface_ids=None, os_profile=None, os_profile_linux_config=None, os_profile_secrets=None, os_profile_windows_config=None, plan=None, primary_network_interface_id=None, proximity_placement_group_id=None, resource_group_name=None, storage_data_disks=None, storage_image_reference=None, storage_os_disk=None, tags=None, vm_size=None, zones=None):
        """
        Get an existing VirtualMachine resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param str id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[dict] additional_capabilities: A `additional_capabilities` block.
        :param pulumi.Input[str] availability_set_id: The ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created.
        :param pulumi.Input[dict] boot_diagnostics: A `boot_diagnostics` block.
        :param pulumi.Input[bool] delete_data_disks_on_termination: Should the Data Disks (either the Managed Disks / VHD Blobs) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
        :param pulumi.Input[bool] delete_os_disk_on_termination: Should the OS Disk (either the Managed Disk / VHD Blob) be deleted when the Virtual Machine is destroyed? Defaults to `false`.
        :param pulumi.Input[dict] identity: A `identity` block.
        :param pulumi.Input[str] license_type: Specifies the BYOL Type for this Virtual Machine. This is only applicable to Windows Virtual Machines. Possible values are `Windows_Client` and `Windows_Server`.
        :param pulumi.Input[str] location: Specifies the Azure Region where the Virtual Machine exists. Changing this forces a new resource to be created.
        :param pulumi.Input[str] name: Specifies the name of the Virtual Machine. Changing this forces a new resource to be created.
        :param pulumi.Input[list] network_interface_ids: A list of Network Interface ID's which should be associated with the Virtual Machine.
        :param pulumi.Input[dict] os_profile: An `os_profile` block. Required when `create_option` in the `storage_os_disk` block is set to `FromImage`.
        :param pulumi.Input[dict] os_profile_linux_config: A `os_profile_linux_config` block.
        :param pulumi.Input[list] os_profile_secrets: One or more `os_profile_secrets` blocks.
        :param pulumi.Input[dict] os_profile_windows_config: A `os_profile_windows_config` block.
        :param pulumi.Input[dict] plan: A `plan` block.
        :param pulumi.Input[str] primary_network_interface_id: 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.
        :param pulumi.Input[str] proximity_placement_group_id: The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created
        :param pulumi.Input[str] resource_group_name: Specifies the name of the Resource Group in which the Virtual Machine should exist. Changing this forces a new resource to be created.
        :param pulumi.Input[list] storage_data_disks: One or more `storage_data_disk` blocks.
        :param pulumi.Input[dict] storage_image_reference: A `storage_image_reference` block.
        :param pulumi.Input[dict] storage_os_disk: A `storage_os_disk` block.
        :param pulumi.Input[dict] tags: A mapping of tags to assign to the Virtual Machine.
        :param pulumi.Input[str] vm_size: Specifies the [size of the Virtual Machine](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-size-specs/).
        :param pulumi.Input[str] zones: A list of a single item of the Availability Zone which the Virtual Machine should be allocated in.

        The **additional_capabilities** object supports the following:

          * `ultraSsdEnabled` (`pulumi.Input[bool]`) - Should Ultra SSD disk be enabled for this Virtual Machine?

        The **boot_diagnostics** object supports the following:

          * `enabled` (`pulumi.Input[bool]`) - Should Boot Diagnostics be enabled for this Virtual Machine?
          * `storageUri` (`pulumi.Input[str]`) - The Storage Account's Blob Endpoint which should hold the virtual machine's diagnostic files.

        The **identity** object supports the following:

          * `identityIds` (`pulumi.Input[list]`) - Specifies a list of user managed identity ids to be assigned to the VM. Required if `type` is `UserAssigned`.
          * `principal_id` (`pulumi.Input[str]`) - The Principal ID for the Service Principal associated with the Managed Service Identity of this Virtual Machine.
          * `type` (`pulumi.Input[str]`) - The Managed Service Identity Type of this Virtual Machine. Possible values are `SystemAssigned` (where Azure will generate a Service Principal for you), `UserAssigned` (where you can specify the Service Principal ID's) to be used by this Virtual Machine using the `identity_ids` field, and `SystemAssigned, UserAssigned` which assigns both a system managed identity as well as the specified user assigned identities.

        The **os_profile** object supports the following:

          * `admin_password` (`pulumi.Input[str]`) - The password associated with the local administrator account.
          * `admin_username` (`pulumi.Input[str]`) - Specifies the name of the local administrator account.
          * `computer_name` (`pulumi.Input[str]`) - Specifies the name of the Virtual Machine.
          * `custom_data` (`pulumi.Input[str]`) - Specifies custom data to supply to the machine. On Linux-based systems, this can be used as a cloud-init script. On other systems, this will be copied as a file on disk. Internally, this provider will base64 encode this value before sending it to the API. The maximum length of the binary array is 65535 bytes.

        The **os_profile_linux_config** object supports the following:

          * `disable_password_authentication` (`pulumi.Input[bool]`) - Specifies whether password authentication should be disabled. If set to `false`, an `admin_password` must be specified.
          * `sshKeys` (`pulumi.Input[list]`) - One or more `ssh_keys` blocks. This field is required if `disable_password_authentication` is set to `true`.
            * `keyData` (`pulumi.Input[str]`) - The Public SSH Key which should be written to the `path` defined above.
            * `path` (`pulumi.Input[str]`) - The path of the destination file on the virtual machine

        The **os_profile_secrets** object supports the following:

          * `sourceVaultId` (`pulumi.Input[str]`) - Specifies the ID of the Key Vault to use.
          * `vaultCertificates` (`pulumi.Input[list]`) - One or more `vault_certificates` blocks.
            * `certificateStore` (`pulumi.Input[str]`) - Specifies the certificate store on the Virtual Machine where the certificate should be added to, such as `My`.
            * `certificateUrl` (`pulumi.Input[str]`) - The ID of the Key Vault Secret. Stored secret is the Base64 encoding of a JSON Object that which is encoded in UTF-8 of which the contents need to be:

        The **os_profile_windows_config** object supports the following:

          * `additionalUnattendConfigs` (`pulumi.Input[list]`) - A `additional_unattend_config` block.
            * `component` (`pulumi.Input[str]`) - Specifies the name of the component to configure with the added content. The only allowable value is `Microsoft-Windows-Shell-Setup`.
            * `content` (`pulumi.Input[str]`) - Specifies the base-64 encoded XML formatted content that is added to the unattend.xml file for the specified path and component.
            * `pass` (`pulumi.Input[str]`) - Specifies the name of the pass that the content applies to. The only allowable value is `oobeSystem`.
            * `settingName` (`pulumi.Input[str]`) - Specifies the name of the setting to which the content applies. Possible values are: `FirstLogonCommands` and `AutoLogon`.

          * `enableAutomaticUpgrades` (`pulumi.Input[bool]`) - Are automatic updates enabled on this Virtual Machine? Defaults to `false.`
          * `provision_vm_agent` (`pulumi.Input[bool]`) - Should the Azure Virtual Machine Guest Agent be installed on this Virtual Machine? Defaults to `false`.
          * `timezone` (`pulumi.Input[str]`) - Specifies the time zone of the virtual machine, [the possible values are defined here](http://jackstromberg.com/2017/01/list-of-time-zones-consumed-by-azure/).
          * `winrms` (`pulumi.Input[list]`) - One or more `winrm` block.
            * `certificateUrl` (`pulumi.Input[str]`) - The ID of the Key Vault Secret which contains the encrypted Certificate which should be installed on the Virtual Machine. This certificate must also be specified in the `vault_certificates` block within the `os_profile_secrets` block.
            * `protocol` (`pulumi.Input[str]`) - Specifies the protocol of listener. Possible values are `HTTP` or `HTTPS`.

        The **plan** object supports the following:

          * `name` (`pulumi.Input[str]`) - Specifies the name of the image from the marketplace.
          * `product` (`pulumi.Input[str]`) - Specifies the product of the image from the marketplace.
          * `publisher` (`pulumi.Input[str]`) - Specifies the publisher of the image.

        The **storage_data_disks** object supports the following:

          * `caching` (`pulumi.Input[str]`) - Specifies the caching requirements for the Data Disk. Possible values include `None`, `ReadOnly` and `ReadWrite`.
          * `create_option` (`pulumi.Input[str]`) - Specifies how the data disk should be created. Possible values are `Attach`, `FromImage` and `Empty`.
          * `disk_size_gb` (`pulumi.Input[float]`) - Specifies the size of the data disk in gigabytes.
          * `lun` (`pulumi.Input[float]`) - Specifies the logical unit number of the data disk. This needs to be unique within all the Data Disks on the Virtual Machine.
          * `managed_disk_id` (`pulumi.Input[str]`) - Specifies the ID of an Existing Managed Disk which should be attached to this Virtual Machine. When this field is set `create_option` must be set to `Attach`.
          * `managedDiskType` (`pulumi.Input[str]`) - Specifies the type of managed disk to create. Possible values are either `Standard_LRS`, `StandardSSD_LRS`, `Premium_LRS` or `UltraSSD_LRS`.
          * `name` (`pulumi.Input[str]`) - The name of the Data Disk.
          * `vhdUri` (`pulumi.Input[str]`) - Specifies the URI of the VHD file backing this Unmanaged Data Disk. Changing this forces a new resource to be created.
          * `write_accelerator_enabled` (`pulumi.Input[bool]`) - Specifies if Write Accelerator is enabled on the disk. This can only be enabled on `Premium_LRS` managed disks with no caching and [M-Series VMs](https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/how-to-enable-write-accelerator). Defaults to `false`.

        The **storage_image_reference** object supports the following:

          * `id` (`pulumi.Input[str]`) - Specifies the ID of the Custom Image which the Virtual Machine should be created from. Changing this forces a new resource to be created.
          * `offer` (`pulumi.Input[str]`) - Specifies the offer of the image used to create the virtual machine. Changing this forces a new resource to be created.
          * `publisher` (`pulumi.Input[str]`) - Specifies the publisher of the image used to create the virtual machine. Changing this forces a new resource to be created.
          * `sku` (`pulumi.Input[str]`) - Specifies the SKU of the image used to create the virtual machine. Changing this forces a new resource to be created.
          * `version` (`pulumi.Input[str]`) - Specifies the version of the image used to create the virtual machine. Changing this forces a new resource to be created.

        The **storage_os_disk** object supports the following:

          * `caching` (`pulumi.Input[str]`) - Specifies the caching requirements for the OS Disk. Possible values include `None`, `ReadOnly` and `ReadWrite`.
          * `create_option` (`pulumi.Input[str]`) - Specifies how the OS Disk should be created. Possible values are `Attach` (managed disks only) and `FromImage`.
          * `disk_size_gb` (`pulumi.Input[float]`) - Specifies the size of the OS Disk in gigabytes.
          * `imageUri` (`pulumi.Input[str]`) - Specifies the Image URI in the format `publisherName:offer:skus:version`. This field can also specify the [VHD uri](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-cli-deploy-templates/#create-a-custom-vm-image) of a custom VM image to clone. When cloning a Custom (Unmanaged) Disk Image the `os_type` field must be set.
          * `managed_disk_id` (`pulumi.Input[str]`) - Specifies the ID of an existing Managed Disk which should be attached as the OS Disk of this Virtual Machine. If this is set then the `create_option` must be set to `Attach`.
          * `managedDiskType` (`pulumi.Input[str]`) - Specifies the type of Managed Disk which should be created. Possible values are `Standard_LRS`, `StandardSSD_LRS` or `Premium_LRS`.
          * `name` (`pulumi.Input[str]`) - Specifies the name of the OS Disk.
          * `os_type` (`pulumi.Input[str]`) - Specifies the Operating System on the OS Disk. Possible values are `Linux` and `Windows`.
          * `vhdUri` (`pulumi.Input[str]`) - Specifies the URI of the VHD file backing this Unmanaged OS Disk. Changing this forces a new resource to be created.
          * `write_accelerator_enabled` (`pulumi.Input[bool]`) - Specifies if Write Accelerator is enabled on the disk. This can only be enabled on `Premium_LRS` managed disks with no caching and [M-Series VMs](https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/how-to-enable-write-accelerator). Defaults to `false`.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["additional_capabilities"] = additional_capabilities
        __props__["availability_set_id"] = availability_set_id
        __props__["boot_diagnostics"] = boot_diagnostics
        __props__["delete_data_disks_on_termination"] = delete_data_disks_on_termination
        __props__["delete_os_disk_on_termination"] = delete_os_disk_on_termination
        __props__["identity"] = identity
        __props__["license_type"] = license_type
        __props__["location"] = location
        __props__["name"] = name
        __props__["network_interface_ids"] = network_interface_ids
        __props__["os_profile"] = os_profile
        __props__["os_profile_linux_config"] = os_profile_linux_config
        __props__["os_profile_secrets"] = os_profile_secrets
        __props__["os_profile_windows_config"] = os_profile_windows_config
        __props__["plan"] = plan
        __props__["primary_network_interface_id"] = primary_network_interface_id
        __props__["proximity_placement_group_id"] = proximity_placement_group_id
        __props__["resource_group_name"] = resource_group_name
        __props__["storage_data_disks"] = storage_data_disks
        __props__["storage_image_reference"] = storage_image_reference
        __props__["storage_os_disk"] = storage_os_disk
        __props__["tags"] = tags
        __props__["vm_size"] = vm_size
        __props__["zones"] = zones
        return VirtualMachine(resource_name, opts=opts, __props__=__props__)

    def translate_output_property(self, prop):
        return tables._CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return tables._SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop
