ALIYUN::VPC::NatIp

更新时间:
复制为 MD 格式

ALIYUN::VPC::NatIp类型用于创建NAT IP地址。

语法

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

属性

属性名称

类型

必须

允许更新

描述

约束

NatIp

String

创建的NAT IP地址。

如果您不指定IP地址,系统会在您的NAT IP地址段中随机分配一个IP地址。

NatIpCidr

String

创建NAT IP地址的地址段。

NatIpCidrId

String

创建NAT IP地址的地址段实例ID。

NatIpDescription

String

创建的NAT IP地址的描述信息。

长度为2~256个字符,必须以字母或中文开头,但不能以http://https://开头。

NatIpName

String

创建的NAT IP地址的名称。

长度为2~128个字符,必须以字母或中文开头,可包含数字、半角句号(.)、下划线(_)和短划线(-)。但不能以http://https://开头。

NatGatewayId

String

NAT IP地址所属的VPC NAT网关实例ID。

Ipv4Prefix

String

创建的 IP 前缀地址段。

该 IP 前缀地址段必须位于 NAT 所在交换机的预留网段内,且预留网段不能被占用。IP 前缀掩码必须为/28。

Ipv4PrefixCount

Integer

自动分配的 IP 前缀数量。

从 NAT 所在交换机的未分配预留网段内随机分配。取值范围:1~10。

返回值

Fn::GetAtt

NatIpId:创建的NAT IP地址实例ID。

NatIp:创建的NAT IP地址。

示例

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
{
  "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"
        ]
      }
    }
  }
}