CINXE.COM
ALIYUN::ECS::SNatEntry - Resource Orchestration Service - Alibaba Cloud Documentation Center
<!DOCTYPE html> <html lang="en" class="transparent alicloud back-to-top"> <link rel="stylesheet" href="//g.alicdn.com/aliyun-help/help-intl-portal-fe/0.3.51/css/index.css" /> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <meta name="spm-id" content="a2c63"> <meta name="data-spm" content="a2c63" /> <meta name="aplus-core" content="aplus.js"> <meta name="aplus-ajax" content="chksum"> <meta name="aplus-waiting" content="MAN"> <meta name="aplus-pvhash" content="1"> <meta name="kloud:supported-langs" content="en,zh,tc,ja"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="applicable-device" content="pc,mobile"> <meta name="aplus-rhost-v" content="sg.mmstat.com"> <meta name="aplus-rhost-g" content="sg.mmstat.com"> <title> ALIYUN::ECS::SNatEntry - Resource Orchestration Service - Alibaba Cloud Documentation Center </title> <meta name="keywords" content="ALIYUN::ECS::SNatEntry,Developer Reference,Resource Orchestration Service"> <meta name="description" content="ALIYUN::ECS::SNatEntry,Resource Orchestration Service:ALIYUN::ECS::SNatEntry is used to configure the Source Network Address Translation (SNAT) table of a NAT gateway."> <script> window.globalData = { website: "intl", lang: "en", nodeId:"48475", channel: "", notfound: "", statusCode: "", errorType: "" }; // UT的全局配置变量,在CDN加载前配置 window.$ACE_TRACKER_CONFIG = { enableHistory: true, enableHash: false }; </script> <!-- <base href="https://www.alibabacloud.com">--> <link rel="canonical" href="https://www.alibabacloud.com/help/en/ros/developer-reference/aliyun-ecs-snatentry"/> <link rel="shortcut icon" href="//img.alicdn.com/tfs/TB1ugg7M9zqK1RjSZPxXXc4tVXa-32-32.png"/> <link rel="stylesheet" href="https://o.alicdn.com/fund/alicloud-pure-layout/css/index.min.css" /> </head> <body data-spm="" class="HAS_ALPS_RESOURCE"><script> with(document)with(body)with(insertBefore(createElement("script"),firstChild))setAttribute("exparams","category=&userid=&aplus&yunid=&&trid=0a58324817400377154304089e541a&asid=AQAAAABT3rZnDW0ycgAAAAD5hWppxT+4kQ==",id="tb-beacon-aplus",src=(location>"https"?"//g":"//g")+".alicdn.com/alilog/mlog/aplus_v2.js") </script> <script async src="https://o.alicdn.com/fund/alicloud-pure-layout/index.js"></script> <div id="app"> <div class="aliyun-app-layout"> <!-- docId:48475 --> <input type="hidden" id="website" value="intl"> <div class="products-wrapper$tip" data-spm="879954"> <section id="products" class="intl-product container"> <div class="row"> <div class="col-lg-3 col-md-3 col-sm-4 col-xs-12" id="navDocument"> <div class="doc-nav"> <a class="doc-center" href="/help/en"> <i class="icon-docs icon-docs-back"></i> Document Center </a> </div> <div class="placeholder-ele"> </div> </div> <div class="col-lg-7 col-md-7 col-sm-8 col-xs-12 doc-content"> <div class="all-products action" id="J_AllProducts"> <div class="all-products-head"> <div class="all-products-title">All Products</div> <div class="all-products-search-wrapper"> <div class="all-products-search focus"> <input autocomplete="off" class="all-products-search-box-input" id="J_AllProductsSearch" placeholder="Search Product" data-spm-anchor-id="a2c4g.11186623.6.i0.1f753945H9RVzu"> <i class="icon-search icon-docs icon-docs-search"></i> <ul class="all-products-search-result" style="display: none;"> </ul> </div> </div> </div> <div class="all-products-body" id="J_AllProductsBody"></div> </div> <div class="search-product-modal"> Search </div> <div class="breadcrumbs-top" data-spm="a1"> <div class="row nav-breadcrumb"> <div class="col-md-12 hidden-sm hidden-xs"> <ul class="breadcrumb text-sm"> <li><a class="active" title="Document Center" href="/help/en">Document Center</a></li> <li><a class="active" title="Resource Orchestration Service" href="/help/en/ros/">Resource Orchestration Service</a></li> <li><a class="active" title="Developer Reference" href="/help/en/ros/developer-reference/">Developer Reference</a></li> <li><a class="active" title="Resource Types" href="/help/en/ros/developer-reference/resource-types/">Resource Types</a></li> <li><a class="active" title="ECS" href="/help/en/ros/developer-reference/ecs/">ECS</a></li> <li><a class="active" title="ALIYUN::ECS::SNatEntry" href="/help/en/ros/developer-reference/aliyun-ecs-snatentry">ALIYUN::ECS::SNatEntry</a></li> </ul> </div> <div class="col-md-4 col-sm-12"> <button type="button" class="navbar-toggle bc mr0" data-toggle="collapse" data-target="#sideMenu-mobile"> <span class="icon-bar"></span> <span class="icon-bar"></span> all-products-head <span class="icon-bar"></span> </button> </div> </div> <form class="search-bar clearfix" method="GET" action="/s/en"> <input type="hidden" name="type" value="doc"/> <div class="select"> <p class="select-text"> <span class="placeholder">This Product</span> <i class="icon-docs icon-docs-selected"></i> </p> <ul class="select-options" style="display:none;"> <li class="option selected" data-value="h_pid_$productId">This Product</li> <li class="option" data-value="">All Products</li> </ul> <input type="hidden" name="rangeinfo" value="h_pid_28850"/> </div> <input autocomplete="off" class="search-key" type="text" placeholder="Search by keyword" name="k"/> <ul class="help-top-search-result" style="display: block;"></ul> <button class="search-submit" type="submit"> <i class="icon-docs icon-docs-search"></i> </button> <div class="collapse-menus select"> <p class="select-text"> <span class="placeholder">Resource Orchestration Service:ALIYUN::ECS::SNatEntry</span> <i class="icon-docs icon-docs-more"></i> </p> </div> </form> </div> <header id="header-faq" class="clearfix"> <a class="doc-center" href="/help/en"> <i class="icon-docs icon-docs-back"></i> Document Center </a> <div class="download-links"> </div> <h1 class="page-title">Resource Orchestration Service:ALIYUN::ECS::SNatEntry</h1> <div class="doc-status"> Last Updated:Jan 18, 2023 </div> </header> <article class="product-description markdown-body"> <div lang="en-US" class="icms-help-docs-content"> <main role="main"> <article role="article" aria-labelledby="title_wm1_8hn_kf7"> <div class="body conbody" data-tag="conbody" id="conbody-4q7-ayn-had"> <p id="shortdesc-o62-30w-0j0" class="shortdesc" data-tag="shortdesc">ALIYUN::ECS::SNatEntry is used to configure the Source Network Address Translation (SNAT) table of a NAT gateway.</p> <section class="section" data-tag="section" id="section-mqx-ccf-lfb"> <h2 class="title sectiontitle" data-tag="title" id="title-p18-f3b-jfz">Syntax</h2> <pre class="pre codeblock language-json" data-tag="codeblock" id="codeblock-osd-820-4mo"><code>{ "Type": "ALIYUN::ECS::SNatEntry", "Properties": { "SNatTableId": String, "SNatIp": String, "SnatEntryName": String, "SourceCIDR": String, "SourceVSwitchId": String } }</code></pre> </section> <section class="section" data-tag="section" id="section-7h7-0e0-21d"> <h2 class="title sectiontitle" data-tag="title" id="title-tnv-iwl-mcp">Properties</h2> <table class="table" data-tag="table" id="table-mns-wkg-bn4"> <caption></caption> <colgroup> <col style="width:17.647058823529413%"> </colgroup> <colgroup> <col style="width:11.76470588235294%"> </colgroup> <colgroup> <col style="width:11.76470588235294%"> </colgroup> <colgroup> <col style="width:11.76470588235294%"> </colgroup> <colgroup> <col style="width:23.52941176470588%"> </colgroup> <colgroup> <col style="width:23.52941176470588%"> </colgroup> <thead class="thead" data-tag="thead" id="thead-q8d-1xk-4tl"> <tr data-tag="row" id="row-tyh-8df-awg"> <th class="entry colsep-1 rowsep-1" data-tag="entry" id="concept-48475-zh-entry-wxz-q7v-48h">Property</th> <th class="entry colsep-1 rowsep-1" data-tag="entry" id="concept-48475-zh-entry-84b-2jf-6zx">Type</th> <th class="entry colsep-1 rowsep-1" data-tag="entry" id="concept-48475-zh-entry-ixu-rhx-li7">Required</th> <th class="entry colsep-1 rowsep-1" data-tag="entry" id="concept-48475-zh-entry-lqw-4mc-q7g">Editable</th> <th class="entry colsep-1 rowsep-1" data-tag="entry" id="concept-48475-zh-entry-yiv-tz5-gx5">Description</th> <th class="entry colsep-1 rowsep-1" data-tag="entry" id="concept-48475-zh-entry-8rc-r0b-2eg">Constraint</th> </tr> </thead> <tbody class="tbody" data-tag="tbody" id="tbody-e84-g8w-h1d"> <tr data-tag="row" id="row-73q-atl-c4z"> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-k0d-dbx-iye"> SNatTableId </td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-kbt-sq4-5br"> String </td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-njc-480-0cl"> Yes </td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-9ho-hu3-343">Yes</td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-n7o-5ca-hwa">The ID of the SNAT table.</td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-q08-i85-ka2">None </td> </tr> <tr data-tag="row" id="row-nbh-23e-z3u"> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-omj-02f-ks8"> SNatIp </td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-l2s-5x6-fmi"> String </td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-2um-jm7-rs4"> Yes </td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-vor-7y3-cko">Yes</td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-ngf-baf-dlc">The public IP address to be translated.</td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-ruz-nqm-x2m">The public IP address must be included in the NAT service plan. It cannot exist in both the forwarding table and the SNAT table. </td> </tr> <tr data-tag="row" id="row-d7y-3x8-nu5"> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-pmb-f8m-nmj">SnatEntryName</td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-vt9-djr-nzj">String</td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-yfu-nxp-wn6">No</td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-hr6-i36-iu4">Yes</td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-kuw-h74-qup">The name of the SNAT entry.</td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-v4p-yji-ja0">The name must be 2 to 128 characters in length. It must start with a letter and cannot start with <code class="ph codeph" data-tag="codeph" id="codeph-n02-3w6-njw">http://</code> or <code class="ph codeph" data-tag="codeph" id="codeph-p40-72c-2lj">https://</code>.</td> </tr> <tr data-tag="row" id="row-bjl-2yd-fon"> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-p47-2yq-s55">SourceCIDR</td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-39w-9r0-sfu">String</td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-2mf-pt7-kh4">No</td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-c62-chc-hlf">No</td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-jgh-y98-obj">The CIDR block of the vSwitch or the IP address of the ECS instance. <ul class="ul" data-tag="ul" id="ul-i2l-yh9-tue"> <li class="li" data-tag="li" id="li-p8c-m0f-ff1">vSwitch granularity: specifies the CIDR block of the vSwitch such as 192.168.1.0/24. When an ECS instance attached to the vSwitch requires Internet access, the NAT gateway provides the SNAT service (Internet proxy service) for the ECS instance. If you specify only one public IP address for the SnatIp parameter, the ECS instance uses the specified public IP address to access the Internet. If you specify multiple public IP addresses for the SnatIp parameter, the ECS instance randomly selects a public IP address from SnatIp to access the Internet.</li> <li class="li" data-tag="li" id="li-dd3-6kt-a1q">ECS granularity: specifies the IP address of the ECS instance such as 192.168.1.1/32. When the ECS instance requires Internet access, the NAT gateway provides the SNAT service (Internet proxy service) for the ECS instance. If you specify only one public IP address for the SnatIp parameter, the ECS instance uses the specified public IP address to access the Internet. If you specify multiple public IP addresses for the SnatIp parameter, the ECS instance randomly selects a public IP address from SnatIp to access the Internet.</li> </ul></td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-1lj-7cp-o2s">You must specify one of the SourceCIDR and SourceVSwtichId parameters, but you cannot specify both of them.</td> </tr> <tr data-tag="row" id="row-0zm-8lr-i7v"> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-vb5-apq-rzd"> SourceVSwitchId </td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-o90-0dt-tnc"> String </td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-k8f-d3l-m71">No</td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-5la-2og-n15">Yes</td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-m0n-ehc-zse">The vSwitch ID of the ECS instance that accesses the Internet by using the SNAT feature.</td> <td class="entry colsep-1 rowsep-1" data-tag="entry" id="entry-epp-8df-ace"> You must specify one of the SourceCIDR and SourceVSwtichId parameters, but you cannot specify both of them.</td> </tr> </tbody> </table> </section> <section class="section" data-tag="section" id="section-ys5-byx-34j"> <h2 class="title sectiontitle" data-tag="title" id="title-nvh-3i4-dt2">Response parameters</h2> <p class="p" data-tag="p" id="p-e4z-xqq-aut">Fn::GetAtt</p> <p class="p" data-tag="p" id="p-the-rlj-n84">SNatEntryId: the ID of each entry in the SNAT table.</p> </section> <section class="section" data-tag="section" id="section-nel-30a-doo"> <h2 class="title sectiontitle" data-tag="title" id="title-9er-gpb-sx2">Example</h2> <ul class="ul" data-tag="ul" id="ul-0ud-yif-tln"> <li class="li collapse expanded" data-tag="li" id="li-pcv-7yu-7ff"><p class="p" data-tag="p" id="p-kfp-nwv-w8z"><code class="ph codeph" data-tag="codeph" id="codeph-5r9-26i-6uz">YAML</code>format</p><pre class="pre codeblock" data-tag="codeblock" id="codeblock-5wc-5c4-4st"><code>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</code></pre></li> <li class="li collapse" data-tag="li" id="li-2ay-rb4-l3l"><p class="p" data-tag="p" id="p-0ls-xee-5ro"><code class="ph codeph" data-tag="codeph" id="codeph-e97-l4l-0m1">JSON</code>format </p><pre class="pre codeblock language-json" data-tag="codeblock" id="codeblock-w15-uzn-umk"><code>{ "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" ] } } } }</code></pre></li> </ul> </section> </div> </article> </main> </div> </article> <script type="text/javascript"> window.storeDocs = { language: '$lang', docGithubLink: '$!githubInfo.url' } </script> <div class="nav-footer"> </div> <div class="alicloud-document-ask clearfix"></div> <div class="feedback-message" style="display:none;"> <span class="hasfeedback acon acon-done-16"></span> Thank you! We've received your feedback. </div> </div> <div class="col-log-2 col-md-2 col-sm-0 col-xs-0 nav-catalog"> <div class="article-catalog" id="articleCatalog"></div> </div> </div> </section> </div> </div> </div> <script src="//g.alicdn.com/aliyun-help/help-intl-portal-fe/0.3.51/js/index.js"></script> <script src="https://cloud-assets.alicdn.com/alicdn/dawn/user-tracker/latest/js/index.js"></script> </body> </html>