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


  "Type": "ALIYUN::ECS::NatGateway",
  "Properties": {
    "DeletionProtection": Boolean,
    "VpcId": String,
    "Description": String,
    "NatGatewayName": String,
    "VSwitchId": String,
    "DeletionForce": Boolean,
    "Spec": String


Parameter Type Required Editable Description Constraint
VpcId String Yse No The ID of the VPC that you want to create NAT Gateway. None
VSwitchId String Yse No The ID of the vSwitch in the specified VPC. None
Description String Erased Released The description of the NAT Gateway. The description must be 2 to 256 characters in length.
NatGatewayName String Erased Released 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 Erased Released The type of the NAT Gateway. Valid values: Small,Middle, and Large.
DeletionProtection Boolean Erased Released Indicates whether deletion protection is enabled. Default value: false. None
DeletionForce Boolean Erased Released Specifies whether to forcibly delete SNAT and DNAT entries in the Gateway and unbind EIP from the NAT gateway. Default value: false. Valid values: 1025 to 10000. You cannot use the following commonly used port numbers: 2222, 4500, 4510, 4560, 7505, 9000, 9001, and 9002.

Response parameters


  • ForwardTableId: the ID of the port forwarding table.
  • The ID of the SNatTableId:SNat source network address translation table.
  • NatGatewayId: the unique ID of the Nat gateway.

Sample request

  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "NatGateway": {
      "Type": "ALIYUN::ECS::NatGateway",
      "Properties": {
        "NatGatewayName": "nat_gateway_1",
        "Description": "my nat gateway",
        "VpcId": "vpc-25o8s****",
        "VSwitchId": "vsw-25rc1****",
        "Spec": "Small"
  "Outputs": {
    "NatGatewayId": {
         "Value": {"Fn::GetAttr": ["NatGateway","NatGatewayId"]}
    "ForwardTableId": {
         "Value": {"Fn::GetAttr": ["NatGateway","ForwardTableId"]}
    "SNatTableId": {
         "Value": {"Fn::GetAttr": ["NatGateway", "SNatTableId"]}