edit-icon download-icon

ALIYUN::ECS::NatGateway

Last Updated: Jun 13, 2018

The ALIYUN::ECS::NatGateway type is used to create a NAT gateway in VPC.

Syntax

  1. {
  2. "Type" : "ALIYUN::ECS::NatGateway",
  3. "Properties" : {
  4. "VpcId" : String,
  5. "Description" : String,
  6. "NatGatewayName" : String,
  7. "VSwitchId" : String,
  8. "BandwidthPackage" : List,
  9. "Spec" : String
  10. }
  11. }

Attributes

Attribute name Type Required Description Constraint
VpcId string Yes ID of the VPC in which you want to create a NAT gateway. N/A
VSwitchId string Yes ID of the VSwitch in the VPC. N/A
BandwidthPackage list Yes Bandwidth package for the NAT gateway. Up to four bandwidth packages can be created.
Description string No NAT gateway description. The description is a string of 2 to 256 characters. The default value is null.
NatGatewayName string No Name of the NAT gateway. The instance name is a string of 2 to 128 characters including letters, digits, Chinese characters, underscores(_), periods(.), and hyphens(-). It must start with an English letter or a Chinese character.
Spec string No NAT gateway specifications. Value options: Small, Middle, and Large.

BandwidthPackage syntax

  1. "BandwidthPackage" : [
  2. {
  3. "Bandwidth" : Integer,
  4. "ZoneId" : String,
  5. "IpCount" : Integer
  6. }
  7. ]

BandwidthPackage attributes

Attribute name Type Required Description Constraint
Bandwidth integer No The bandwidth size. Value range: [5, 5000] in Mbps; default value: 5 Mbps.
ZoneId string No Zone is the region where the NAT gateway is located. N/A
IpCount integer No Number of assigned public IP addresses. Value range: [1, 5].

Return values

Fn::GetAtt

  • ForwardTableId: ID of the port forwarding table.-SNatTableId SNat: ID of the SNAT table.
  • NatGatewayId: unique ID of the NAT gateway.
  • BandwidthPackageIds: IDs of all bandwidth packages.
  • BandwidthPackageIps: IP addresses included in all bandwidth packages.

Example

  1. {
  2. "ROSTemplateFormatVersion" : "2015-09-01",
  3. "Resources" : {
  4. "NatGateway": {
  5. "Type": "ALIYUN::ECS::NatGateway",
  6. "Properties": {
  7. "NatGatewayName": "nat_gateway_1",
  8. "Description": "my nat gateway",
  9. "VpcId": "vpc-25o8sqkwb",
  10. "VSwitchId": "vsw-25rc1y5t9",
  11. "Spec": "Small",
  12. "BandwidthPackage" : [
  13. {
  14. "IpCount": 1,
  15. "Bandwidth" : 5,
  16. "ZoneId": "cn-beijing-c"
  17. },
  18. {
  19. "IpCount": 1,
  20. "Bandwidth" : 5,
  21. "ZoneId": "cn-beijing-c"
  22. },
  23. {
  24. "IpCount": 1,
  25. "Bandwidth" : 5,
  26. "ZoneId": "cn-beijing-c"
  27. },
  28. {
  29. "IpCount": 1,
  30. "Bandwidth" : 5,
  31. "ZoneId": "cn-beijing-c"
  32. },
  33. {
  34. "IpCount": 1,
  35. "Bandwidth" : 5,
  36. "ZoneId": "cn-beijing-c"
  37. }
  38. ]
  39. }
  40. }
  41. },
  42. "Outputs": {
  43. "NatGatewayId": {
  44. "Value" : {"Fn::GetAttr": ["NatGateway","NatGatewayId"]}
  45. },
  46. "BandwidthPackageIds": {
  47. "Value" : {"Fn::GetAttr": ["NatGateway","BandwidthPackageIds"]}
  48. },
  49. "ForwardTableId": {
  50. "Value" : {"Fn::GetAttr": ["NatGateway","ForwardTableId"]}
  51. },
  52. "SNatTableId": {
  53. "Value" : {"Fn::GetAttr": ["NatGateway", "SNatTableId"]}
  54. }
  55. }
  56. }
Thank you! We've received your feedback.