Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::VPC::NatIp

Última atualização: Jun 27, 2026

Cria um endereço IP NAT para um gateway NAT da VPC.

Sintaxe

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

Propriedades

Parâmetro

Tipo

Obrigatório

Atualização Permitida

Descrição

Restrições

NatIp

String

Não

Não

Endereço IP NAT a ser criado.

Se você não especificar esta propriedade, o sistema aloca aleatoriamente um endereço IP do bloco CIDR NAT especificado.

NatIpCidr

String

Sim

Não

Bloco CIDR ao qual o endereço IP NAT pertence.

Nenhuma.

NatIpCidrId

String

Não

Não

ID do bloco CIDR ao qual o endereço IP NAT pertence.

Nenhuma.

NatIpDescription

String

Sim

Sim

Descrição do endereço IP NAT.

A descrição deve ter de 2 a 256 caracteres, começar com uma letra e não pode iniciar com http:// ou https://.

NatIpName

String

Sim

Sim

Nome do endereço IP NAT.

O nome deve ter de 2 a 128 caracteres, começar com uma letra e pode conter dígitos, pontos (.), sublinhados (_) e hifens (-). Não pode iniciar com http:// ou https://.

NatGatewayId

String

Sim

Não

ID do gateway NAT da VPC ao qual o endereço IP NAT pertence.

Nenhuma.

Ipv4Prefix

String

Não

Não

Prefixo de IP a ser criado.

O prefixo de IP deve originar-se de um bloco CIDR reservado e disponível no vSwitch onde o gateway NAT está localizado. A máscara do prefixo deve ser /28.

Ipv4PrefixCount

Integer

Não

Não

Quantidade de prefixos de IP a serem alocados automaticamente.

O sistema aloca aleatoriamente os prefixos de IP de blocos CIDR reservados não alocados no vSwitch onde o gateway NAT está localizado. Valores válidos: 1 a 10.

Valores de retorno

Fn::GetAtt

NatIpId: o ID do endereço IP NAT criado.

NatIp: o endereço IP NAT criado.

Exemplos

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