ALIYUN::ECS::SNatEntry类型用于配置NAT网关中的源地址转换表。

语法

{
  "Type": "ALIYUN::ECS::SNatEntry",
  "Properties": {
    "SNatTableId": String,
    "SNatIp": String,
    "SourceVSwitchId": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
SNatTableId String 源地址转换表ID。
SNatIp String 用于源地址转换的公网IP。 必须是NAT网关中带宽包的IP。每个NAT Gateway上的公网IP,不能既存在于端口转发表中,也存在于SNAT表中。
SourceVSwitchId String 可通过NAT网关的SNAT功能访问互联网的ECS实例所在的VSwitch ID。

返回值

Fn::GetAtt

SNatEntryId:源地址转换表中的表项ID。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SourceVSwitchId": {
      "Type": "String",
      "Description": "Allow which switch can access internet."
    },
    "SNatTableId": {
      "Type": "String",
      "Description": "Create SNAT entry in specified SNAT table."
    },
    "SNatIp": {
      "Type": "String",
      "Description": "Source IP, must belongs to bandwidth package internet IP"
    }
  },
  "Resources": {
    "SNatTableEntry": {
      "Type": "ALIYUN::ECS::SNatEntry",
      "Properties": {
        "SourceVSwitchId": {
          "Ref": "SourceVSwitchId"
        },
        "SNatTableId": {
          "Ref": "SNatTableId"
        },
        "SNatIp": {
          "Ref": "SNatIp"
        }
      }
    }
  },
  "Outputs": {
    "SNatEntryId": {
      "Description": "The id of created SNAT entry.",
      "Value": {
        "Fn::GetAtt": [
          "SNatTableEntry",
          "SNatEntryId"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SourceVSwitchId:
    Type: String
    Description: Allow which switch can access internet.
  SNatTableId:
    Type: String
    Description: Create SNAT entry in specified SNAT table.
  SNatIp:
    Type: String
    Description: 'Source IP, must belongs to bandwidth package internet IP'
Resources:
  SNatTableEntry:
    Type: 'ALIYUN::ECS::SNatEntry'
    Properties:
      SourceVSwitchId:
        Ref: SourceVSwitchId
      SNatTableId:
        Ref: SNatTableId
      SNatIp:
        Ref: SNatIp
Outputs:
  SNatEntryId:
    Description: The id of created SNAT entry.
    Value:
      'Fn::GetAtt':
        - SNatTableEntry
        - SNatEntryId