ALIYUN::ECS::SNatEntry is used to configure the Source Network Address Translation (SNAT) table of a NAT gateway.

Syntax

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

Properties

Property Type Required Editable Description Constraint
SNatTableId String Yes Yes The ID of the SNAT table. None
SNatIp String Yes Yes The public IP address to be translated. The public IP address must be included in the bandwidth plan of the NAT gateway. It cannot exist in both the forwarding table and the SNAT table.
SourceVSwitchId String Yes Yes The ID of the VSwitch that accesses the Internet by using the SNAT function. None

Response parameters

Fn::GetAtt

SNatEntryId: the ID of each entry in the SNAT table.

Examples

JSON format

{
  "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 format

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