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
  }
}

Properties

Property Type Required Editable Description Constraint
NatIp String No No The NAT IP address. If you do not specify an IP address, the system selects a random IP address from the specified 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 in length and start with a letter. The description 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 in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter and cannot start with http:// or https://.
NatGatewayId String Yes No The ID of the Virtual Private Cloud (VPC) NAT gateway for which you want to create the NAT IP address. None.

Return values

Fn::GetAtt

NatIpId: the ID of the created NAT IP address.

NatIp: the created NAT IP address.

Examples

  • JSON format

    {
      "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 in length. It must start with a letter\nbut cannot start with http:// or https://.",
          "MinLength": 2,
          "MaxLength": 256
        },
        "NatIpName": {
          "Type": "String",
          "Description": "The name of the NAT IP address.\nThe name must be 2 to 128 characters in length, and can contain letters, digits, periods\n(.), underscores (_), and hyphens (-). It must start with a letter. It cannot start\nwith http:// or https://.",
          "MinLength": 2,
          "MaxLength": 128
        },
        "NatGatewayId": {
          "Type": "String",
          "Description": "The ID of the Virtual Private Cloud (VPC) NAT gateway for which you want to create\nthe NAT IP address."
        }
      },
      "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 NAT IP address.",
          "Value": {
            "Fn::GetAtt": [
              "VPCNatIp",
              "NatIpId"
            ]
          }
        }
      }
    }
  • YAML format

    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 in length. It must start with a letter
          but cannot start with http:// or https://.
        MinLength: 2
        MaxLength: 256
      NatIpName:
        Type: String
        Description: |-
          The name of the NAT IP address.
          The name must be 2 to 128 characters in length, and can contain letters, digits, periods
          (.), underscores (_), and hyphens (-). It must start with a letter. It cannot start
          with http:// or https://.
        MinLength: 2
        MaxLength: 128
      NatGatewayId:
        Type: String
        Description: |-
          The ID of the Virtual Private Cloud (VPC) NAT gateway for which you want to create
          the NAT IP address.
    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 NAT IP address.
        Value:
          Fn::GetAtt:
            - VPCNatIp
            - NatIpId