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

     1  ---
     2  layout: "alicloud"
     3  page_title: "Alicloud: alicloud_nat_gateway"
     4  sidebar_current: "docs-alicloud-resource-nat-gateway"
     5  description: |-
     6    Provides a resource to create a VPC NAT Gateway.
     7  ---
     8  
     9  # alicloud\_nat\_gateway
    10  
    11  Provides a resource to create a VPC NAT Gateway.
    12  
    13  ~> **NOTE:** alicloud_nat_gateway must depends on alicloud_vswitch.
    14  
    15  
    16  ## Example Usage
    17  
    18  Basic usage
    19  
    20  ```
    21  resource "alicloud_vpc" "vpc" {
    22    name       = "tf_test_foo"
    23    cidr_block = "172.16.0.0/12"
    24  }
    25  
    26  resource "alicloud_vswitch" "vsw" {
    27    vpc_id            = "${alicloud_vpc.vpc.id}"
    28    cidr_block        = "172.16.0.0/21"
    29    availability_zone = "cn-beijing-b"
    30  }
    31  
    32  resource "alicloud_nat_gateway" "nat_gateway" {
    33    vpc_id = "${alicloud_vpc.vpc.id}"
    34    spec   = "Small"
    35    name   = "test_foo"
    36  
    37    bandwidth_packages = [{
    38      ip_count  = 1
    39      bandwidth = 5
    40      zone      = "cn-beijing-b"
    41    },
    42      {
    43        ip_count  = 2
    44        bandwidth = 10
    45        zone      = "cn-beijing-b"
    46      },
    47    ]
    48  
    49    depends_on = [
    50      "alicloud_vswitch.vsw",
    51    ]
    52  }
    53  ```
    54  
    55  ## Argument Reference
    56  
    57  The following arguments are supported:
    58  
    59  * `vpc_id` - (Required, Forces New Resorce) The VPC ID.
    60  * `spec` - (Required, Forces New Resorce) The specification of the nat gateway. Valid values are `Small`, `Middle` and `Large`. Details refer to [Nat Gateway Specification](https://help.aliyun.com/document_detail/42757.html?spm=5176.doc32322.6.559.kFNBzv)
    61  * `name` - (Optional) Name of the nat gateway. The value 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://. Defaults to null.
    62  * `description` - (Optional) Description of the nat gateway, This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Defaults to null.
    63  * `bandwidth_packages` - (Required) A list of bandwidth packages for the nat gatway.
    64  
    65  ## Block bandwidth package
    66  
    67  The bandwidth package mapping supports the following:
    68  
    69  * `ip_count` - (Required) The IP number of the current bandwidth package. Its value range from 1 to 50.
    70  * `bandwidth` - (Required) The bandwidth value of the current bandwidth package. Its value range from 5 to 5000.
    71  * `zone` - (Optional) The AZ for the current bandwidth. If this value is not specified, Terraform will set a random AZ.
    72  * `public_ip_addresses` - (Computer) The public ip for bandwidth package. the public ip count equal `ip_count`, multi ip would complex with ",", such as "10.0.0.1,10.0.0.2".
    73  
    74  ## Attributes Reference
    75  
    76  The following attributes are exported:
    77  
    78  * `id` - The ID of the nat gateway.
    79  * `name` - The name of the nat gateway.
    80  * `description` - The description of the nat gateway.
    81  * `spec` - The specification of the nat gateway.
    82  * `vpc_id` - The VPC ID for the nat gateway.
    83  * `bandwidth_package_ids` - A list ID of the bandwidth packages, and split them with commas
    84  * `snat_table_ids` - The nat gateway will auto create a snap and forward item, the `snat_table_ids` is the created one.
    85  * `forward_table_ids` - The nat gateway will auto create a snap and forward item, the `forward_table_ids` is the created one.