azure::virtual-machine

Creates a virtual machine.

Example

azure::virtual-machine virtual-machine-example
     name: "virtual-machine-example"
     resource-group: $(azure::resource-group resource-group-example-VM)
     network: $(azure::network network-example-VM)
     subnet: "subnet1"
     os-type: "linux"
     os-disk: $(azure::disk os-disk-example-VM)
     delete-os-disk-on-terminate: true
     data-disks: [ $(azure::disk data-disk-example-VM) ]
     network-interface: $(azure::network-interface network-interface-example-VM)
     vm-image-type: "popular"
     known-virtual-image: "UBUNTU_SERVER_14_04_LTS"
     admin-user-name: "qwerty@123"
     admin-password: "qwerty@123"
     caching-type: "NONE"
     vm-size-type: "STANDARD_G1"
     storage-account-type-data-disk: "STANDARD_LRS"
     storage-account-type-os-disk: "STANDARD_LRS"

     tags: {
         Name: "virtual-machine-example"
     }
end

Attributes

Attribute Description
name Name of the Virtual Machine. (Required)
resource-group The resource group under which the Virtual Machine would reside. (Required)
network The virtual network which would be associated with this. (Required)
network-interface The network interface that the Virtual Machine would use.
admin-user-name Login user name for the Virtual Machine.
availability-set The availability set of the Virtual Machine.
admin-password Login password for the Virtual Machine.
public-ip-address The Public ip address associated with the Virtual Machine.
private-ip-address Private ip address associated with the Virtual Machine.
os-type The os for the Virtual Machine. Valid values are linux or windows. (Required)
os-disk The OS Disk to be attached to the Virtual Machine.
delete-os-disk-on-terminate Determines if the OS Disk should be deleted when the VM is terminated.
data-disks set The Data Disks to be attached to the Virtual Machine.
subnet One of the subnet name from the assigned virtual network.
vm-image-type Type of Virtual Machine image. Defaults to specialized. Valid values are popular, specialized, latest, specific, custom or gallery. (Required)
ssh The ssh public key to be associated to the Virtual Machine.
stored-image The id of a stored image to create the Virtual Machine.
custom-image The id of a custom image to create the Virtual Machine.
gallery-image-version The version of a gallery image to create the Virtual Machine.
caching-type The caching type for the Virtual Machine.
storage-account-type-data-disk The data disk storage account type for the Virtual Machine. Valid values are STANDARD_LRS, PREMIUM_LRS or STANDARDSSD_LRS.
storage-account-type-os-disk The os disk storage account type for the Virtual Machine. Valid values are STANDARD_LRS, PREMIUM_LRS or STANDARDSSD_LRS.
vm-size-type The size of the Virtual Machine.
known-virtual-image The known Virtual Machine image type.
time-zone The time zone for the Virtual Machine.
image-publisher The publisher of the image to be used for creating the Virtual Machine. Required if vm-image-type selected as latest or specific.
image-offer The offer of the image to be used for creating the Virtual Machine. Required if vm-image-type selected as latest or specific.
image-sku The SKU of the image to be used for creating the Virtual Machine. Required if vm-image-type selected as latest or specific.
image-region The region where the image resides to be used for creating the Virtual Machine. Required if vm-image-type selected as specific.
image-version The version of the image to be used for creating the Virtual Machine. Required if vm-image-type selected as specific.
secondary-network-interface set A list of secondary network interface that the Virtual Machine would use.
tags map Tags for the Virtual Machine.
custom-data The custom data for the Virtual Machine. Not supported if vm-image-type selected as specialized.
enable-system-managed-service-identity Enable system managed service identity for the Virtual Machine. Defaults to false.
identities set A list of identities associated with the virtual machine.
launch-date The launch date of the virtual machine.

Outputs

Attribute Description
id The ID for the Virtual Machine.
vm-id Shortened ID for the Virtual Machine.
system-managed-service-identity-principal-id The principal id for the system managed service identity of the Virtual Machine.
state The state of the virtual machine.
location The location of the virtual machine.
computer-name The computer name of the virtual machine.
public-ip-address-ip The public ip address ip of the virtual machine.