文档

ALIYUN::VPC::SnatEntry

更新时间:

ALIYUN::VPC::SnatEntry类型用于在SNAT列表中添加SNAT条目。

语法

{
  "Type": "ALIYUN::VPC::SnatEntry",
  "Properties": {
    "SnatTableId": String,
    "SnatEntryName": String,
    "SourceVSwitchIds": List,
    "SourceCIDR": String,
    "SnatIp": String,
    "EipAffinity": Integer
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

SnatTableId

String

SNAT表ID。

SnatEntryName

String

SNAT规则的名称。

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

SourceVSwitchIds

List

需要公网访问的交换机的ID。

SourceCIDR

String

交换机或ECS实例的网段。

不能同时指定SourceCIDR和SourceVSwitchIds。

SnatIp

String

公网IP地址。

多个IP之间用半角逗号(,)间隔。

EipAffinity

Integer

是否打开EIP亲和性。

取值:

  • 0:关闭EIP亲和性。

  • 1:打开EIP亲和性。

说明

打开EIP亲和性开关后,如果SNAT绑定多个EIP,同一个客户端将使用相同的EIP访问公网,否则客户端将从绑定的EIP中随机选取EIP访问公网。

返回值

Fn::GetAtt

SnatEntryIds:SNAT条目ID。

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SourceVSwitchId:
    AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
    Type: String
    Label:
      zh-cn: 网络交换机ID
      en: VSwitch ID
  SnatIp:
    Type: String
    Description: The public IP address. Separate multiple EIPs with commas.
  SnatTableId:
    Type: String
    Description: The ID of the SNAT table.
Resources:
  SnatEntry:
    Type: ALIYUN::VPC::SnatEntry
    Properties:
      SourceVSwitchIds:
        - Ref: SourceVSwitchId
      SnatIp:
        Ref: SnatIp
      SnatTableId:
        Ref: SnatTableId
Outputs:
  SnatEntryIds:
    Description: The IDS of the SNAT entry.
    Value:
      Fn::GetAtt:
        - SnatEntry
        - SnatEntryIds

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SourceVSwitchId": {
      "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
      "Type": "String",
      "Label": {
        "zh-cn": "网络交换机ID",
        "en": "VSwitch ID"
      }
    },
    "SnatIp": {
      "Type": "String",
      "Description": "The public IP address. Separate multiple EIPs with commas."
    },
    "SnatTableId": {
      "Type": "String",
      "Description": "The ID of the SNAT table."
    }
  },
  "Resources": {
    "SnatEntry": {
      "Type": "ALIYUN::VPC::SnatEntry",
      "Properties": {
        "SourceVSwitchIds": [
          {
            "Ref": "SourceVSwitchId"
          }
        ],
        "SnatIp": {
          "Ref": "SnatIp"
        },
        "SnatTableId": {
          "Ref": "SnatTableId"
        }
      }
    }
  },
  "Outputs": {
    "SnatEntryIds": {
      "Description": "The IDS of the SNAT entry.",
      "Value": {
        "Fn::GetAtt": [
          "SnatEntry",
          "SnatEntryIds"
        ]
      }
    }
  }
}
  • 本页导读 (1)
文档反馈