github.com/candidpartners/terraform@v0.9.5-0.20171005231213-29f5f88820f6/examples/alicloud-ecs-special-sg/main.tf (about)

     1  provider "alicloud" {
     2    alias = "bj"
     3    region = "cn-beijing"
     4  }
     5  
     6  resource "alicloud_instance" "instance" {
     7    provider = "alicloud.bj"
     8    instance_name = "website-${format(var.count_format, count.index+1)}"
     9    host_name = "website-${format(var.count_format, count.index+1)}"
    10    image_id = "centos7u2_64_40G_cloudinit_20160728.raw"
    11    instance_type = "ecs.s2.large"
    12    count = "6"
    13    availability_zone = "cn-beijing-b"
    14    security_groups = "${var.security_groups}"
    15  
    16    internet_charge_type = "PayByBandwidth"
    17  
    18    io_optimized = "none"
    19  
    20    password = "${var.ecs_password}"
    21  
    22    allocate_public_ip = "false"
    23  
    24    instance_charge_type = "PostPaid"
    25    system_disk_category = "cloud"
    26  
    27  
    28    tags {
    29      env = "prod"
    30      product = "website"
    31      dc = "beijing"
    32    }
    33  
    34  }
    35  
    36  resource "alicloud_slb_attachment" "foo" {
    37    slb_id = "${var.slb_id}"
    38    instances = ["${alicloud_instance.instance.0.id}", "${alicloud_instance.instance.1.id}"]
    39  }