github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/website/source/docs/providers/alicloud/r/instance.html.markdown (about)

     1  ---
     2  layout: "alicloud"
     3  page_title: "Alicloud: alicloud_instance"
     4  sidebar_current: "docs-alicloud-resource-instance"
     5  description: |-
     6    Provides a ECS instance resource.
     7  ---
     8  
     9  # alicloud\_instance
    10  
    11  Provides a ECS instance resource.
    12  
    13  ## Example Usage
    14  
    15  ```
    16  # Create a new ECS instance for classic
    17  resource "alicloud_security_group" "classic" {
    18    name        = "tf_test_foo"
    19    description = "foo"
    20  }
    21  
    22  resource "alicloud_instance" "classic" {
    23    # cn-beijing
    24    availability_zone = "cn-beijing-b"
    25    security_groups = ["${alicloud_security_group.classic.*.id}"]
    26  
    27    allocate_public_ip = true
    28  
    29    # series II
    30    instance_type        = "ecs.n1.medium"
    31    io_optimized         = "optimized"
    32    system_disk_category = "cloud_efficiency"
    33    image_id             = "ubuntu_140405_64_40G_cloudinit_20161115.vhd"
    34    instance_name        = "test_foo"
    35  }
    36  
    37  # Create a new ECS instance for VPC
    38  resource "alicloud_vpc" "default" {
    39    # Other parameters...
    40  }
    41  
    42  resource "alicloud_vswitch" "default" {
    43    # Other parameters...
    44  }
    45  
    46  resource "alicloud_slb" "vpc" {
    47    name       = "test-slb-tf"
    48    vpc_id     = "${alicloud_vpc.default.id}"
    49    vswitch_id = "${alicloud_vswitch.default.id}"
    50  }
    51  ```
    52  
    53  ## Argument Reference
    54  
    55  The following arguments are supported:
    56  
    57  * `image_id` - (Required) The Image to use for the instance.
    58  * `instance_type` - (Required) The type of instance to start.
    59  * `io_optimized` - (Required) Valid values are `none`, `optimized`, If `optimized`, the launched ECS instance will be I/O optimized.
    60  * `security_groups` - (Optional)  A list of security group ids to associate with.
    61  * `availability_zone` - (Optional) The Zone to start the instance in.
    62  * `instance_name` - (Optional) The name of the ECS. This instance_name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://. If not specified, 
    63  Terraform will autogenerate a default name is `ECS-Instance`.
    64  * `allocate_public_ip` - (Optional) Associate a public ip address with an instance in a VPC or Classic. Boolean value, Default is false.
    65  * `system_disk_category` - (Optional) Valid values are `cloud`, `cloud_efficiency`, `cloud_ssd`, For I/O optimized instance type, `cloud_ssd` and `cloud_efficiency` disks are supported. For non I/O Optimized instance type, `cloud` disk are supported. 
    66  * `system_disk_size` - (Optional) Size of the system disk, value range: 40GB ~ 500GB. Default is 40GB.
    67  * `description` - (Optional) Description of the instance, This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.
    68  * `internet_charge_type` - (Optional) Internet charge type of the instance, Valid values are `PayByBandwidth`, `PayByTraffic`. Default is `PayByBandwidth`.
    69  * `internet_max_bandwidth_in` - (Optional) Maximum incoming bandwidth from the public network, measured in Mbps (Mega bit per second). Value range: [1, 200]. If this value is not specified, then automatically sets it to 200 Mbps.
    70  * `internet_max_bandwidth_out` - (Optional) Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). Value range:  [0, 100], If this value is not specified, then automatically sets it to 0 Mbps.
    71  * `host_name` - (Optional) Host name of the ECS, which is a string of at least two characters. “hostname” cannot start or end with “.” or “-“. In addition, two or more consecutive “.” or “-“ symbols are not allowed. On Windows, the host name can contain a maximum of 15 characters, which can be a combination of uppercase/lowercase letters, numerals, and “-“. The host name cannot contain dots (“.”) or contain only numeric characters.
    72  On other OSs such as Linux, the host name can contain a maximum of 30 characters, which can be segments separated by dots (“.”), where each segment can contain uppercase/lowercase letters, numerals, or “_“.
    73  * `password` - (Optional) Password to an instance is a string of 8 to 30 characters. It must contain uppercase/lowercase letters and numerals, but cannot contain special symbols.
    74  * `vswitch_id` - (Optional) The virtual switch ID to launch in VPC. If you want to create instances in VPC network, this parameter must be set.
    75  * `instance_charge_type` - (Optional) Valid values are `PrePaid`, `PostPaid`, The default is `PostPaid`.
    76  * `period` - (Optional) The time that you have bought the resource, in month. Only valid when instance_charge_type is set as `PrePaid`. Value range [1, 12].
    77  * `tags` - (Optional) A mapping of tags to assign to the resource.
    78  
    79  ## Attributes Reference
    80  
    81  The following attributes are exported:
    82  
    83  * `id` - The instance ID.
    84  * `availability_zone` - The Zone to start the instance in.
    85  * `instance_name` - The instance name.
    86  * `host_name` - The instance host name.
    87  * `description` - The instance description.
    88  * `status` - The instance status.
    89  * `image_id` - The instance Image Id.
    90  * `instance_type` - The instance type.
    91  * `instance_network_type` - The instance network type and it has two values: `vpc` and `classic`.
    92  * `io_optimized` - The instance whether I/O optimized.
    93  * `private_ip` - The instance private ip.
    94  * `public_ip` - The instance public ip.
    95  * `vswitch_id` - If the instance created in VPC, then this value is  virtual switch ID.
    96  * `tags` - The instance tags, use jsonencode(item) to display the value.