github.com/hobbeswalsh/terraform@v0.3.7-0.20150619183303-ad17cf55a0fa/website/source/docs/providers/azure/r/instance.html.markdown (about)

     1  ---
     2  layout: "azure"
     3  page_title: "Azure: azure_instance"
     4  sidebar_current: "docs-azure-resource-instance"
     5  description: |-
     6    Creates a hosted service, role and deployment and then creates a virtual machine in the deployment based on the specified configuration.
     7  ---
     8  
     9  # azure\_instance
    10  
    11  Creates a hosted service, role and deployment and then creates a virtual 
    12  machine in the deployment based on the specified configuration.
    13  
    14  ## Example Usage
    15  
    16  ```
    17  resource "azure_instance" "web" {
    18      name = "terraform-test"
    19      image = "Ubuntu Server 14.04 LTS"
    20      size = "Basic_A1"
    21      storage_service_name = "yourstorage"
    22      location = "West US"
    23      username = "terraform"
    24      password = "Pass!admin123"
    25  
    26      endpoint {
    27          name = "SSH"
    28          protocol = "tcp"
    29          public_port = 22
    30          private_port = 22
    31      }
    32  }
    33  ```
    34  
    35  ## Argument Reference
    36  
    37  The following arguments are supported:
    38  
    39  * `name` - (Required) The name of the instance. Changing this forces a new
    40      resource to be created.
    41  
    42  * `description` - (Optional) The description for the associated hosted service.
    43      Changing this forces a new resource to be created (defaults to the instance
    44      name).
    45  
    46  * `image` - (Required) The name of an existing VM or OS image to use for this
    47      instance. Changing this forces a new resource to be created.
    48  
    49  * `size` - (Required) The size of the instance.
    50  
    51  * `subnet` - (Optional) The name of the subnet to connect this instance to. If
    52      a value is supplied `virtual_network` is required. Changing this forces a
    53      new resource to be created.
    54  
    55  * `virtual_network` - (Optional) The name of the virtual network the `subnet`
    56      belongs to. If a value is supplied `subnet` is required. Changing this
    57      forces a new resource to be created.
    58  
    59  * `storage_service_name` - (Optional) The name of an existing storage account
    60      within the subscription which will be used to store the VHDs of this
    61      instance. Changing this forces a new resource to be created.
    62  
    63  * `reverse_dns` - (Optional) The DNS address to which the IP address of the
    64      hosted service resolves when queried using a reverse DNS query. Changing
    65      this forces a new resource to be created.
    66  
    67  * `location` - (Required) The location/region where the cloud service is
    68      created. Changing this forces a new resource to be created.
    69  
    70  * `automatic_updates` - (Optional) If true this will enable automatic updates.
    71      This attribute is only used when creating a Windows instance. Changing this
    72      forces a new resource to be created (defaults false)
    73  
    74  * `time_zone` - (Optional) The appropriate time zone for this instance in the
    75      format 'America/Los_Angeles'. This attribute is only used when creating a
    76      Windows instance. Changing this forces a new resource to be created
    77      (defaults false)
    78  
    79  * `username` - (Required) The username of a new user that will be created while
    80      creating the instance. Changing this forces a new resource to be created.
    81  
    82  * `password` - (Optional) The password of the new user that will be created
    83      while creating the instance. Required when creating a Windows instance or
    84      when not supplying an `ssh_key_thumbprint` while creating a Linux instance.
    85      Changing this forces a new resource to be created.
    86  
    87  * `ssh_key_thumbprint` - (Optional) The SSH thumbprint of an existing SSH key
    88      within the subscription. This attribute is only used when creating a Linux
    89      instance. Changing this forces a new resource to be created.
    90  
    91  * `security_group` - (Optional) The Network Security Group to associate with
    92      this instance.
    93  
    94  * `endpoint` - (Optional) Can be specified multiple times to define multiple
    95      endpoints. Each `endpoint` block supports fields documented below.
    96  
    97  The `endpoint` block supports:
    98  
    99  * `name` - (Required) The name of the external endpoint.
   100  
   101  * `protocol` - (Optional) The transport protocol for the endpoint. Valid
   102      options are: `tcp` and `udp` (defaults `tcp`)
   103  
   104  * `public_port` - (Required) The external port to use for the endpoint.
   105  
   106  * `private_port` - (Required) The private port on which the instance is
   107      listening.
   108  
   109  ## Attributes Reference
   110  
   111  The following attributes are exported:
   112  
   113  * `id` - The instance ID.
   114  * `description` - The description for the associated hosted service.
   115  * `subnet` - The subnet the instance is connected to.
   116  * `endpoint` - The complete set of configured endpoints.
   117  * `security_group` - The associated Network Security Group.
   118  * `ip_address` - The private IP address assigned to the instance.
   119  * `vip_address` - The public IP address assigned to the instance.