github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/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\_ecs 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_group_id = "${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 * `availability_zone` - (Required) The Zone to start the instance in. 58 * `image_id` - (Required) The Image to use for the instance. 59 * `instance_type` - (Required) The type of instance to start. 60 * `security_group_ids` - (Required) A list of security group ids to associate with. If you are creating Instances in a VPC, use `vpc_security_group_ids` instead. 61 `security_group_ids` instead. 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 name beginning with `tf-ecs`. 64 * `allocate_public_ip` - (Optional) Associate a public ip address with an instance in a VPC or Classic. Boolean value, Default is false. 65 * `io_optimized` - (Optional) Valid 66 values are `none`, `optimized`, If `optimized`, the launched ECS instance will be I/O optimized. Default is `optimized`. 67 * `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. 68 * `system_disk_size` - (Optional) Size of the system disk, value range: 40GB ~ 500GB. Default is 40GB. 69 * `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. 70 * `internet_charge_type` - (Optional) Internet charge type of the instance, Valid values are `PayByBandwidth`, `PayByTraffic`. Default is `PayByBandwidth`. 71 * `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. 72 * `internet_max_bandwidth_out` - (Optional) Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). Value range: 73 `internet_charge_type` is `PayByBandwidth`: this value range [0, 100], If this value is not specified, then automatically sets it to 0 Mbps; If `internet_charge_type` is `PayByTraffic`: this value range [1, 100]. this value must be set value, such as 5. 74 * `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. 75 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 “_“. 76 * `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. 77 * `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. 78 * `instance_charge_type` - (Optional) Valid values are `PrePaid`, `PostPaid`, The default is `PostPaid`. 79 * `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]. 80 * `private_ip` - (Optional) Private IP address to associate with the instance in a VPC. 81 * `tags` - (Optional) A mapping of tags to assign to the resource. 82 83 ## Attributes Reference 84 85 The following attributes are exported: 86 87 * `id` - The instance ID. 88 * `availability_zone` - The Zone to start the instance in. 89 * `instance_name` - The instance name. 90 * `host_name` - The instance host name. 91 * `description` - The instance description. 92 * `status` - The instance status. 93 * `image_id` - The instance Image Id. 94 * `instance_type` - The instance type. 95 * `instance_network_type` - The instance network type and it has two values: `vpc` and `classic`. 96 * `io_optimized` - The instance whether I/O optimized. 97 * `private_ip` - The instance private ip. 98 * `public_ip` - The instance public ip. 99 * `vswitch_id` - If the instance created in VPC, then this value is virtual switch ID. 100 * `tags` - The instance tags, use jsonencode(item) to display the value.