ALIYUN::ECS::SNatEntry类型用于配置NAT网关中的源地址转换表。
语法
{
  "Type": "ALIYUN::ECS::SNatEntry",
  "Properties": {
    "SNatTableId": String,
    "SNatIp": String,
    "SnatEntryName": String,
    "SourceCIDR": String,
    "SourceVSwitchId": String
  }
}属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
|---|---|---|---|---|---|
| SNatTableId | String | 是 | 是 | 源地址转换表ID。 | 无 | 
| SNatIp | String | 是 | 是 | 用于源地址转换的公网IP。 | 必须是NAT网关中带宽包的IP。每个NAT网关上的公网IP,不能既存在于端口转发表中,也存在于SNAT表中。 | 
| SnatEntryName | String | 否 | 是 | SNAT条目的名称。 | 长度为2~128个字符,必须以英文字母或汉字开头,但不能以 http://或https://开头。 | 
| SourceCIDR | String | 否 | 否 | 交换机或ECS实例的网段。 
 | 不能同时指定SourceCIDR和SourceVSwtichId,必须指定其中之一。 | 
| SourceVSwitchId | String | 否 | 是 | 可通过NAT网关的SNAT功能访问互联网的ECS实例所在的vSwitch ID。 | 不能同时指定SourceCIDR和SourceVSwtichId,必须指定其中之一。 | 
返回值
Fn::GetAtt
SNatEntryId:源地址转换表中的表项ID。
示例
- JSON格式- { "ROSTemplateFormatVersion": "2015-09-01", "Parameters": { "SourceVSwitchId": { "Type": "String", "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId", "Description": "Allow which switch can access internet." }, "SNatTableId": { "Type": "String", "Description": "Create SNAT entry in specified SNAT table." } }, "Resources": { "SNatTableEntry": { "Type": "ALIYUN::ECS::SNatEntry", "Properties": { "SourceVSwitchId": { "Ref": "SourceVSwitchId" }, "SnatEntryName": "test_entry_name", "SNatTableId": { "Ref": "SNatTableId" }, "SNatIp": "100.100.100.1" } } }, "Outputs": { "SNatEntryId": { "Description": "The id of created SNAT entry.", "Value": { "Fn::GetAtt": [ "SNatTableEntry", "SNatEntryId" ] } } } }