github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/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 ## Example Usage 14 15 Basic usage 16 17 ``` 18 resource "alicloud_vpc" "vpc" { 19 name = "tf_test_foo" 20 cidr_block = "172.16.0.0/12" 21 } 22 23 resource "alicloud_vswitch" "vsw" { 24 vpc_id = "${alicloud_vpc.vpc.id}" 25 cidr_block = "172.16.0.0/21" 26 availability_zone = "cn-beijing-b" 27 } 28 29 resource "alicloud_nat_gateway" "nat_gateway" { 30 vpc_id = "${alicloud_vpc.vpc.id}" 31 spec = "Small" 32 name = "test_foo" 33 34 bandwidth_packages = [{ 35 ip_count = 1 36 bandwidth = 5 37 zone = "cn-beijing-b" 38 }, 39 { 40 ip_count = 2 41 bandwidth = 10 42 zone = "cn-beijing-b" 43 }, 44 ] 45 46 depends_on = [ 47 "alicloud_vswitch.vsw", 48 ] 49 } 50 ``` 51 52 ## Argument Reference 53 54 The following arguments are supported: 55 56 * `vpc_id` - (Required, Forces New Resorce) The VPC ID. 57 * `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) 58 * `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. 59 * `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. 60 * `bandwidth_packages` - (Required) A list of bandwidth packages for the nat gatway. 61 62 ## Block bandwidth package 63 64 The bandwidth package mapping supports the following: 65 66 * `ip_count` - (Required) The IP number of the current bandwidth package. Its value range from 1 to 50. 67 * `bandwidth` - (Required) The bandwidth value of the current bandwidth package. Its value range from 5 to 5000. 68 * `zone` - (Optional) The AZ for the current bandwidth. If this value is not specified, Terraform will set a random AZ. 69 70 ## Attributes Reference 71 72 The following attributes are exported: 73 74 * `id` - The ID of the nat gateway. 75 * `name` - The name of the nat gateway. 76 * `description` - The description of the nat gateway. 77 * `spec` - The specification of the nat gateway. 78 * `vpc_id` - The VPC ID for the nat gateway. 79 * `bandwidth_package_ids` - A list ID of the bandwidth packages, and split them with commas