github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/examples/alicloud-vpc/main.tf (about)

     1  resource "alicloud_vpc" "main" {
     2    name = "${var.long_name}"
     3    cidr_block = "${var.vpc_cidr}"
     4  }
     5  
     6  resource "alicloud_vswitch" "main" {
     7    vpc_id = "${alicloud_vpc.main.id}"
     8    count = "${length(split(",", var.availability_zones))}"
     9    cidr_block = "${lookup(var.cidr_blocks, "az${count.index}")}"
    10    availability_zone = "${var.availability_zones}"
    11    depends_on = [
    12      "alicloud_vpc.main"]
    13  }
    14  
    15  resource "alicloud_nat_gateway" "main" {
    16    vpc_id = "${alicloud_vpc.main.id}"
    17    spec = "Small"
    18    bandwidth_packages = [
    19      {
    20        ip_count = 1
    21        bandwidth = 5
    22        zone = "${var.availability_zones}"
    23      }
    24    ]
    25    depends_on = [
    26      "alicloud_vswitch.main"]
    27  }
    28