Creates an SNAT entry in a NAT Gateway SNAT table.
Syntax
{
"Type": "ALIYUN::ECS::SNatEntry",
"Properties": {
"SNatTableId": String,
"SNatIp": String,
"SnatEntryName": String,
"SourceCIDR": String,
"SourceVSwitchId": String
}
}
Properties
| Property name | Type | Required | Update allowed | Description | Constraints |
| SNatTableId | String | Yes | Yes | The SNAT table ID. | None |
| SNatIp | String | Yes | Yes | The public IP address for SNAT. | Must be from the NAT Gateway bandwidth plan. A public IP address cannot exist in both the forwarding table and the SNAT table. |
| SnatEntryName | String | No | Yes | The name of the SNAT entry. | The name must be 2 to 128 characters in length. It must start with a letter or a Chinese character and cannot start with http:// or https://. |
| SourceCIDR | String | No | No | The CIDR block of the vSwitch or ECS instance.
|
Specify either SourceCIDR or SourceVSwitchId. |
| SourceVSwitchId | String | No | Yes | The vSwitch ID. ECS instances in this vSwitch use the SNAT entry to access the Internet. | Specify either SourceCIDR or SourceVSwitchId. |
Return values
Fn::GetAtt
SNatEntryId: The ID of the SNAT entry.
Examples
-
JSONformat{ "ROSTemplateFormatVersion": "2015-09-01", "Parameters": { "SourceVSwitchId": { "Type": "String", "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId", "Description": "The vSwitch that is allowed to access the Internet." }, "SNatTableId": { "Type": "String", "Description": "The SNAT table in which to create the SNAT entry." } }, "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 the created SNAT entry.", "Value": { "Fn::GetAtt": [ "SNatTableEntry", "SNatEntryId" ] } } } }
该文章对您有帮助吗?