ALIYUN::SLB::Listener 型はリスナーを作成する場合に使用します。

構文

  1. { Type : ALIYUN::SLB::Listener”, Properties : { Protocol : String, HealthCheck : Map, ListenerPort : Integer, Persistence : Map, Bandwidth : Integer, BackendServerPort : Integer, Scheduler : String, LoadBalancerId : String, CACertificateId : String, ServerCertificateId : String, VServerGroupId : String }}

プロパティ

名前 データ型 必須/省略可能 更新可/不可 説明 制約
Protocol String 必須 不可 IP プロトコル 値のオプション : http、https、tcp、および udp
ListenerPort integer 必須 不可 Server Load Balancer インスタンスに使用されるフロントエンドポート 値の範囲 : [1, 65535]
Bandwidth integer 必須 不可 リスナーのピーク帯域幅 値の範囲 : [1, 1000] または -1。単位 : Mbps。PayByBandwidth モードで課金されるパブリックインスタンスの場合、このパラメーターを -1 に設定することはできず、さまざまなリスナーに割り当てられたピーク帯域幅の合計が、Server Load Balancer インスタンスの作成時に指定された帯域幅値を超えることはできません。PayByTraffic モードで課金されるパブリックインスタンスの場合、このパラメーターは -1 に設定でき、ピーク帯域幅制限が適用されないことが分かります。
BackendServerPort integer 必須 不可 Server Load Balancer インスタンスに使用されるバックエンドポート 値の範囲 : [1, 65535]
LoadBalancerId String 必須 不可 Server Load Balancer インスタンスの ID なし
HealthCheck Map 省略可能 不可 ヘルスチェック設定 ヘルスチェック設定
Persistence Map 省略可能 不可 持続性関連パラメーター なし
Scheduler String 省略可能 不可 スケジューリングのアルゴリズム 値のオプション : wrr および wlc。 デフォルト値 : true。
CACertificateId String 省略可能 不可 CA 証明書 ID このパラメーターは HTTPS の場合のみ有効です。 CA 証明書とサーバー証明書の両方がアップロードされると、双方向認証が採用されます。 サーバー証明書のみがアップロードされる場合は、一方向認証が採用されます。
ServerCertificateId String 省略可能 不可 サーバー証明書 ID このパラメーターは必須で、HTTPS の場合のみ有効です。
VServerGroupId String 省略可能 不可 仮想サーバーグループ ID なし

HealthCheck の構文

  1. HealthCheck : { Domain : String, Interval : Integer, URI : String, HttpCode : String, HealthyThreshold : Integer, Timeout : Integer, UnhealthyThreshold : Integer, Port : Integer}

HealthCheck のプロパティ

名前 データ型 必須/省略可能 更新可/不可 説明 制約
Domain String 省略可能 不可 ヘルスチェックに使用されるドメイン

値のオプション : $ _ip、カスタム文字列、および NULL。

カスタム文字列は 1 - 80 文字で構成され、文字、数字、ハイフン (-)、およびピリオド (.) のみを含めることができます。

このパラメーターが $ _ip または NULL に設定されている場合、Server Load Balancer インスタンスはヘルスチェックのドメインとしてバックエンドサーバーのプライベート IP アドレスを使用します。

Interval integer 省略可能 不可 ヘルスチェック間隔 値の範囲 : 3 - 600 (秒)
URI String 省略可能 不可 ヘルスチェックに使用される URI 値は 1 - 80 文字の文字列です。 先頭文字はスラッシュ (/) にし、指定できるのは英字、数字、ハイフン (-)、スラッシュ (/)、ピリオド (.)、パーセント (%)、疑問符 (?)、ポンド記号 (#)、およびアンパサンド (&) のみです。
HttpCode String 省略可能 不可 ヘルスチェック用の HTTP ステータスコード

複数の HTTP ステータスコードはコンマ (,) で区切ります。

値のオプション : http_2xx、http_3xx、http_4xx、およびhttp_5xx。

デフォルト値 : http_2xx

HealthyThreshold integer 省略可能 不可 ヘルスチェックが成功したと判断する場合に使用されるしきい値です。 この値は、バックエンドサーバーのヘルスチェックステータスを「失敗」から「成功」に変更するために必要な連続して成功したヘルスチェックの数を示します。 値の範囲 : [1, 10]
Timeout integer 省略可能 不可 ヘルスチェックのレスポンスを返すまでの最大タイムアウト時間

値の範囲 : [1, 50] (秒)。

重要 Timeout の値が Interval よりも小さい場合、Timeout は無効であり、Interval の値がタイムアウト時間とみなされます。
  1. </td>
  2. </tr>
  3. <tr>
  4. <td class="entry colsep-1 rowsep-1"> UnhealthyThreshold </td>
  5. <td class="entry colsep-1 rowsep-1"> integer </td>
  6. <td class="entry colsep-1 rowsep-1"> 省略可能 </td>
  7. <td class="entry colsep-1 rowsep-1"> 不可 </td>
  8. <td class="entry colsep-1 rowsep-1"> ヘルスチェックが失敗したと判断する場合に使用されるしきい値。 この値は、バックエンドサーバーのヘルスチェックステータスを「成功」から「失敗」に変更する場合に必要な、連続して失敗したヘルスチェックの数を示します。
  9. </td>
  10. <td class="entry colsep-1 rowsep-1"> 値の範囲 : [1, 10] </td>
  11. </tr>
  12. <tr>
  13. <td class="entry colsep-1 rowsep-1"> Port </td>
  14. <td class="entry colsep-1 rowsep-1"> integer </td>
  15. <td class="entry colsep-1 rowsep-1"> 省略可能 </td>
  16. <td class="entry colsep-1 rowsep-1"> 不可 </td>
  17. <td class="entry colsep-1 rowsep-1"> ヘルスチェックに使用されるポート </td>
  18. <td class="entry colsep-1 rowsep-1"> 値の範囲 : [0, 65535] </td>
  19. </tr>
  20. </tbody>
  21. </table>
  22. </section>
  23. <section class="section">
  24. <h2 class="title sectiontitle" id="h2-url-5">Persistence の構文</h2>
  25. <pre class="pre codeblock language-json"><code>"Persistence" : {
  26. "PersistenceTimeout" : Integer,
  27. "CookieTimeout" : Integer,
  28. "XForwardedFor" : String,
  29. "Cookie" : String,
  30. "StickySession" : String,
  31. "StickySessionType" : String,

}

  1. <section class="section">
  2. <h2 class="title sectiontitle" id="h2-url-6">Persistence のプロパティ</h2>
  3. <table class="table">
  4. <caption></caption>
  5. <colgroup>
  6. <col style="width:16.666666666666664%">
  7. <col style="width:16.666666666666664%">
  8. <col style="width:16.666666666666664%">
  9. <col style="width:16.666666666666664%">
  10. <col style="width:16.666666666666664%">
  11. <col style="width:16.666666666666664%">
  12. </colgroup>
  13. <thead class="thead">
  14. <tr>
  15. <th class="entry colsep-1 rowsep-1" id="concept-51202-zh-entry-127">名前</th>
  16. <th class="entry colsep-1 rowsep-1" id="concept-51202-zh-entry-128">データ型</th>
  17. <th class="entry colsep-1 rowsep-1" id="concept-51202-zh-entry-129">必須/省略可能</th>
  18. <th class="entry colsep-1 rowsep-1" id="concept-51202-zh-entry-130">更新可/不可</th>
  19. <th class="entry colsep-1 rowsep-1" id="concept-51202-zh-entry-131">説明</th>
  20. <th class="entry colsep-1 rowsep-1" id="concept-51202-zh-entry-132">制約</th>
  21. </tr>
  22. </thead>
  23. <tbody class="tbody">
  24. <tr>
  25. <td class="entry colsep-1 rowsep-1"> StickySession </td>
  26. <td class="entry colsep-1 rowsep-1"> String </td>
  27. <td class="entry colsep-1 rowsep-1"> 必須 </td>
  28. <td class="entry colsep-1 rowsep-1"> 不可 </td>
  29. <td class="entry colsep-1 rowsep-1"> セッション維持の有効化/無効化 </td>
  30. <td class="entry colsep-1 rowsep-1"> 値のオプション : on および off </td>
  31. </tr>
  32. <tr>
  33. <td class="entry colsep-1 rowsep-1"> PersistenceTimeout </td>
  34. <td class="entry colsep-1 rowsep-1"> integer </td>
  35. <td class="entry colsep-1 rowsep-1"> 省略可能 </td>
  36. <td class="entry colsep-1 rowsep-1"> いいえ </td>
  37. <td class="entry colsep-1 rowsep-1"> 接続持続タイムアウト時間 </td>
  38. <td class="entry colsep-1 rowsep-1"> 値の範囲 : [0, 1000] (秒)。 デフォルト値 : 0。接続の持続性が無効になっていることを示します。 </td>
  39. </tr>
  40. <tr>
  41. <td class="entry colsep-1 rowsep-1"> CookieTimeout </td>
  42. <td class="entry colsep-1 rowsep-1"> integer </td>
  43. <td class="entry colsep-1 rowsep-1"> 省略可能 </td>
  44. <td class="entry colsep-1 rowsep-1"> 不可 </td>
  45. <td class="entry colsep-1 rowsep-1"> Cookie のタイムアウト </td>
  46. <td class="entry colsep-1 rowsep-1">
  47. <p class="p"> このパラメーターは、StickySession が on、StickySessionType が insert のときに設定する必要があります。 それ以外の場合、このパラメーターは無視されます。</p>
  48. <p class="p"> 値の範囲 : [1, 86400] (秒)。</p>
  49. </td>
  50. </tr>
  51. <tr>
  52. <td class="entry colsep-1 rowsep-1"> XForwardedFor </td>
  53. <td class="entry colsep-1 rowsep-1"> String </td>
  54. <td class="entry colsep-1 rowsep-1"> 省略可能 </td>
  55. <td class="entry colsep-1 rowsep-1"> 不可 </td>
  56. <td class="entry colsep-1 rowsep-1"> 訪問者の実際の IP アドレスを取得するため X-Forwarded-For レコードを使用するかどうか </td>
  57. <td class="entry colsep-1 rowsep-1"> 値のオプション : on および off。 デフォルト値 : on。 </td>
  58. </tr>
  59. <tr>
  60. <td class="entry colsep-1 rowsep-1"> Cookie </td>
  61. <td class="entry colsep-1 rowsep-1"> String </td>
  62. <td class="entry colsep-1 rowsep-1"> 省略可能 </td>
  63. <td class="entry colsep-1 rowsep-1"> 不可 </td>
  64. <td class="entry colsep-1 rowsep-1"> サーバーに設定された Cookie </td>
  65. <td class="entry colsep-1 rowsep-1">
  66. <p class="p"> このパラメーターは、StickySession が on で StickySessionType が server のときに設定する必要があります。 それ以外の場合、このパラメーターは無視されます。</p>
  67. <p class="p">このパラメーター値は 1- 200 文字の文字列で、RFC 2965 規格に準拠しています。 含められるのは ASCII の英字と数字だけです。 コンマ (,)、セミコロン
  68. (;)、またはスペースを含めることはできません。また、先頭文字をドル記号 ($) にすることはできません。
  69. </p>
  70. </td>
  71. </tr>
  72. <tr>
  73. <td class="entry colsep-1 rowsep-1"> StickySessionType </td>
  74. <td class="entry colsep-1 rowsep-1"> String </td>
  75. <td class="entry colsep-1 rowsep-1"> 省略可能 </td>
  76. <td class="entry colsep-1 rowsep-1"> 不可 </td>
  77. <td class="entry colsep-1 rowsep-1"> Cookie の処理方法 </td>
  78. <td class="entry colsep-1 rowsep-1">
  79. <p class="p">このパラメーターは StickySession が on に設定されているときに設定する必要があります。 StickySession が off の場合、このパラメーターは無視されます。</p>
  80. <p class="p">値のオプション : insert および server</p>
  81. insert は、Server Load Balancer インスタンスによる挿入を示します。server は、Server Load Balancer インスタンスによるバックエンドサーバーからの読み取りを示します。
  82. </td>
  83. </tr>
  84. </tbody>
  85. </table>
  86. </section>
  87. <section class="section" id="section-zrf-qcz-lfb">
  88. <h2 class="title sectiontitle" id="h2-url-7">レスポンス値</h2>
  89. <p class="p"><strong class="ph b">Fn::GetAtt</strong></p>
  90. <ul class="ul" id="ul-rnm-qcz-lfb">
  91. <li class="li">LoadBalancerId : Server Load Balancer インスタンスの一意の ID</li>
  92. <li class="li">ListenerPortsAndProtocol : Server Load Balancer インスタンスのフロントエンドポートとプロトコル (配列形式)</li>
  93. </ul>
  94. </section>
  95. <section class="section" id="section-c4m-tcz-lfb">
  96. <h2 class="title sectiontitle" id="h2-url-8">コーディング例</h2>
  97. <pre class="pre codeblock language-json"><code>{
  98. "ROSTemplateFormatVersion": "2015-09-01",
  99. "Resources": {
  100. "LoadBalancer": {
  101. "Type": "ALIYUN::SLB::LoadBalancer",
  102. "Properties": {
  103. "LoadBalancerName": "createdByHeat",
  104. "AddressType": "internet",
  105. "InternetChargeType": "paybybandwidth"
  106. }
  107. },
  108. "CreateListener": {
  109. "Type": "ALIYUN::SLB::Listener",
  110. "Properties": {
  111. "LoadBalancerId": {"Ref": "LoadBalancer"},
  112. "ListenerPort": "8094",
  113. "BackendServerPort": 8080,
  114. "Bandwidth": 1,
  115. "Protocol": "http",
  116. "HealthCheck": {
  117. "HealthyThreshold": 3,
  118. "UnhealthyThreshold": 3,
  119. "Interval": 2,
  120. "Timeout": 5,
  121. "HttpCode": "http_2xx,http_3xx,http_4xx,http_5xx"
  122. },
  123. "Scheduler": "wrr",
  124. "Persistence": {
  125. "PersistenceTimeout": 1,
  126. "XForwardedFor": 1,
  127. "StickySession": 1,
  128. "StickySessionType": 1,
  129. "CookieTimeout": 0,
  130. "Cookie": 1
  131. }
  132. }
  133. }
  134. },
  135. "Outputs": {
  136. "LoadBalanceDetails": {
  137. "Value" : {"Fn::GetAtt": ["LoadBalancer", "LoadBalancerId"]}
  138. }

}}

  1. </div>
  2. </article>
  3. </main>