github.com/arvindram03/terraform@v0.3.7-0.20150212015210-408f838db36d/website/source/docs/providers/azure/r/virtual_machine.html.markdown (about) 1 --- 2 layout: "azure" 3 page_title: "Azure: azure_virtual_machine" 4 sidebar_current: "docs-azure-resource-virtual-machine" 5 description: |- 6 Manages a Virtual Machine resource within Azure. 7 --- 8 9 # azure\_virtual\_machine 10 11 Manages a Virtual Machine resource within Azure. 12 13 ## Example Usage 14 15 ``` 16 resource "azure_virtual_machine" "default" { 17 name = "test" 18 location = "West US" 19 image = "b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140724-en-us-30GB" 20 size = "Basic_A1" 21 username = "${var.username}" 22 password = ""${var.password}" 23 ssh_public_key_file = "${var.azure_ssh_public_key_file}" 24 endpoint { 25 name = "http" 26 protocol = "tcp" 27 port = 80 28 local_port = 80 29 } 30 } 31 ``` 32 33 ## Argument Reference 34 35 The following arguments are supported: 36 37 * `name` - (Required) A name for the virtual machine. It must use between 3 and 38 24 lowercase letters and numbers and it must be unique within Azure. 39 40 * `location` - (Required) The location that the virtual machine should be created in. 41 42 * `image` - (Required) A image to be used to create the virtual machine. 43 44 * `size` - (Required) Size that you want to use for the virtual machine. 45 46 * `username` - (Required) Name of the account that you will use to administer 47 the virtual machine. You cannot use root for the user name. 48 49 * `password` - (Optional) Password for the admin account. 50 51 * `ssh_public_key_file` - (Optional) SSH key (PEM format). 52 53 * `ssh_port` - (Optional) SSH port. 54 55 * `endpoint` - (Optional) Can be specified multiple times for each 56 endpoint rule. Each endpoint block supports fields documented below. 57 58 The `endpoint` block supports: 59 60 * `name` - (Required) The name of the endpoint. 61 * `protocol` - (Required) The protocol. 62 * `port` - (Required) The public port. 63 * `local_port` - (Required) The private port. 64 65 ## Attributes Reference 66 67 The following attributes are exported: 68 69 * `url` - The URL for the virtual machine deployment. 70 * `ip_address` - The internal IP address of the virtual machine. 71 * `vip_address` - The public Virtual IP address of the virtual machine.