ALIYUN::ECS::NatGateway is used to create a NAT Gateway for a VPC.

Syntax

{
  "Type": "ALIYUN::ECS::NatGateway",
  "Properties": {
    "VpcId": String,
    "Description": String,
    "NatGatewayName": String,
    "VSwitchId": String,
    "BandwidthPackage": List,
    "Spec": String
  }
}

Properties

Name Type Required Description Validity
VpcId String Yes The ID of the VPC for which you want to create a NAT Gateway. None
VSwitchId String Yes The ID of the VSwitch in the VPC. None
BandwidthPackage List No The list of bandwidth packages created for the NAT Gateway. You can create a maximum of four bandwidth packages.
Description String No The description of the NAT Gateway. The description must be 2 to 256 characters in length. This parameter is empty by default.
NatGatewayName String No The name of the NAT Gateway. The name must be 2 to 128 characters in length and can contain letters, digits, underscores (_), periods (.), and hyphens (-). It must start with a letter.
Spec String No The specifications of the NAT Gateway. Valid values: Small, Middle, and Large.

BandwidthPackage syntax

"BandwidthPackage": [
  {
    "Bandwidth": Integer,
    "ZoneId": String,
    "IpCount": Integer
  }
]

BandwidthPackage properties

Name Type Required Description Validity
Bandwidth Integer No The network bandwidth supported by the NAT Gateway.

Valid values: 5 to 5,000. Unit: Mbit/s.

Default value: 5.

ZoneId String No The ID of the zone where the NAT Gateway resides. None
IpCount Integer No The number of assigned public IP addresses. Valid values: 1 to 5.

Response parameters

Fn::GetAtt

  • ForwardTableId: the ID of the forwarding table.
  • SNatTableId: the ID of the SNAT table.
  • NatGatewayId: the unique ID of the NAT Gateway.
  • BandwidthPackageIds: the list of IDs of all bandwidth packages.
  • BandwidthPackageIps: the list of IP addresses included in all bandwidth packages.

Examples

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "NatGateway": {
      "Type": "ALIYUN::ECS::NatGateway",
      "Properties": {
        "NatGatewayName": "nat_gateway_1",
        "Description": "my nat gateway",
        "VpcId": "vpc-25o8sqkwb",
        "VSwitchId": "vsw-25rc1y5t9",
        "Spec": "Small",
        "BandwidthPackage": [
           {
              "IpCount": 1,
              "Bandwidth": 5,
              "ZoneId": "cn-beijing-c"
           },
           {
              "IpCount": 1,
              "Bandwidth": 5,
              "ZoneId": "cn-beijing-c"
           },
           {
              "IpCount": 1,
              "Bandwidth": 5,
              "ZoneId": "cn-beijing-c"
           },
           {
              "IpCount": 1,
              "Bandwidth": 5,
              "ZoneId": "cn-beijing-c"
           },
           {
              "IpCount": 1,
              "Bandwidth": 5,
              "ZoneId": "cn-beijing-c"
           }
        ]
      }
    }
  },
  "Outputs": {
    "NatGatewayId": {
         "Value": {"Fn::GetAttr": ["NatGateway","NatGatewayId"]}
    },
    "BandwidthPackageIds": {
         "Value": {"Fn::GetAttr": ["NatGateway","BandwidthPackageIds"]}
    },
    "ForwardTableId": {
         "Value": {"Fn::GetAttr": ["NatGateway","ForwardTableId"]}
    },
    "SNatTableId": {
         "Value": {"Fn::GetAttr": ["NatGateway", "SNatTableId"]}
    }
  }
}