All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::VPC::NatIp

Last Updated:Mar 28, 2026

ALIYUN::VPC::NatIp is used to create a NAT IP address.

Syntax

{
  "Type": "ALIYUN::VPC::NatIp",
  "Properties": {
    "NatIp": String,
    "NatIpCidr": String,
    "NatIpCidrId": String,
    "NatIpDescription": String,
    "NatIpName": String,
    "NatGatewayId": String,
    "Ipv4Prefix": String,
    "Ipv4PrefixCount": Integer
  }
}

Properties

Parameter

Type

Required

Update Allowed

Description

Constraints

NatIp

String

No

No

The NAT IP address to create.

If you do not specify this property, the system randomly allocates an IP address from the specified NAT CIDR block.

NatIpCidr

String

Yes

No

The CIDR block to which the NAT IP address belongs.

None.

NatIpCidrId

String

No

No

The ID of the CIDR block to which the NAT IP address belongs.

None.

NatIpDescription

String

Yes

Yes

The description of the NAT IP address.

The description must be 2 to 256 characters long, start with a letter, and cannot start with http:// or https://.

NatIpName

String

Yes

Yes

The name of the NAT IP address.

The name must be 2 to 128 characters long. It must start with a letter and can contain digits, periods (.), underscores (_), and hyphens (-). It cannot start with http:// or https://.

NatGatewayId

String

Yes

No

The ID of the VPC NAT gateway to which the NAT IP address belongs.

None.

Ipv4Prefix

String

No

No

The IP prefix to create.

The IP prefix must be from an available, reserved CIDR block in the switch where the NAT gateway is located. The prefix mask must be /28.

Ipv4PrefixCount

Integer

No

No

The number of IP prefixes to automatically allocate.

The system randomly allocates the IP prefixes from unallocated reserved CIDR blocks in the switch where the NAT gateway is located. Valid values: 1 to 10.

Return values

Fn::GetAtt

NatIpId: the ID of the created NAT IP address.

NatIp: the created NAT IP address.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  NatIpCidr:
    Type: String
    Description: The CIDR block to which the NAT IP address belongs.
  NatIpDescription:
    Type: String
    Description: |-
      The description of the NAT IP address.
      The description must be 2 to 256 characters long, start with a letter,
      and cannot start with http:// or https://.
    MinLength: 2
    MaxLength: 256
  NatIpName:
    Type: String
    Description: |-
      The name of the NAT IP address.
      The name must start with a letter and be 2 to 128 characters long. It can contain letters, digits, periods
      (.), underscores (_), and hyphens (-). It cannot start with http:// or https://.
    MinLength: 2
    MaxLength: 128
  NatGatewayId:
    Type: String
    Description: |-
      The ID of the VPC NAT gateway to which the NAT IP address will belong.
Resources:
  VPCNatIp:
    Type: ALIYUN::VPC::NatIp
    Properties:
      NatIpCidr:
        Ref: NatIpCidr
      NatIpDescription:
        Ref: NatIpDescription
      NatIpName:
        Ref: NatIpName
      NatGatewayId:
        Ref: NatGatewayId
Outputs:
  NatIpId:
    Description: The ID of the created NAT IP address.
    Value:
      Fn::GetAtt:
        - VPCNatIp
        - NatIpId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "NatIpCidr": {
      "Type": "String",
      "Description": "The CIDR block to which the NAT IP address belongs."
    },
    "NatIpDescription": {
      "Type": "String",
      "Description": "The description of the NAT IP address.\nThe description must be 2 to 256 characters long, start with a letter,\nand cannot start with http:// or https://.",
      "MinLength": 2,
      "MaxLength": 256
    },
    "NatIpName": {
      "Type": "String",
      "Description": "The name of the NAT IP address.\nThe name must start with a letter and be 2 to 128 characters long. It can contain letters, digits, periods\n(.), underscores (_), and hyphens (-). It cannot start with http:// or https://.",
      "MinLength": 2,
      "MaxLength": 128
    },
    "NatGatewayId": {
      "Type": "String",
      "Description": "The ID of the VPC NAT gateway to which the NAT IP address will belong."
    }
  },
  "Resources": {
    "VPCNatIp": {
      "Type": "ALIYUN::VPC::NatIp",
      "Properties": {
        "NatIpCidr": {
          "Ref": "NatIpCidr"
        },
        "NatIpDescription": {
          "Ref": "NatIpDescription"
        },
        "NatIpName": {
          "Ref": "NatIpName"
        },
        "NatGatewayId": {
          "Ref": "NatGatewayId"
        }
      }
    }
  },
  "Outputs": {
    "NatIpId": {
      "Description": "The ID of the created NAT IP address.",
      "Value": {
        "Fn::GetAtt": [
          "VPCNatIp",
          "NatIpId"
        ]
      }
    }
  }
}