CLI で DescribeLoadBalancerPolicyTypes を使用する - AWS SDK コード例

Doc AWS SDK Examples GitHub リポジトリには、他にも SDK の例があります。 AWS

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

CLI で DescribeLoadBalancerPolicyTypes を使用する

以下のコード例は、DescribeLoadBalancerPolicyTypes の使用方法を示しています。

CLI
AWS CLI

Elastic Load Balancing で定義されるロードバランサーポリシータイプを記述するには

この例では、ロードバランサーのポリシー設定を作成するために使用できるロードバランサーポリシータイプを記述します。

コマンド:

aws elb describe-load-balancer-policy-types

出力:

{ "PolicyTypeDescriptions": [ { "PolicyAttributeTypeDescriptions": [ { "Cardinality": "ONE", "AttributeName": "ProxyProtocol", "AttributeType": "Boolean" } ], "PolicyTypeName": "ProxyProtocolPolicyType", "Description": "Policy that controls whether to include the IP address and port of the originating request for TCP messages. This policy operates on TCP/SSL listeners only" }, { "PolicyAttributeTypeDescriptions": [ { "Cardinality": "ONE", "AttributeName": "PublicKey", "AttributeType": "String" } ], "PolicyTypeName": "PublicKeyPolicyType", "Description": "Policy containing a list of public keys to accept when authenticating the back-end server(s). This policy cannot be applied directly to back-end servers or listeners but must be part of a BackendServerAuthenticationPolicyType." }, { "PolicyAttributeTypeDescriptions": [ { "Cardinality": "ONE", "AttributeName": "CookieName", "AttributeType": "String" } ], "PolicyTypeName": "AppCookieStickinessPolicyType", "Description": "Stickiness policy with session lifetimes controlled by the lifetime of the application-generated cookie. This policy can be associated only with HTTP/HTTPS listeners." }, { "PolicyAttributeTypeDescriptions": [ { "Cardinality": "ZERO_OR_ONE", "AttributeName": "CookieExpirationPeriod", "AttributeType": "Long" } ], "PolicyTypeName": "LBCookieStickinessPolicyType", "Description": "Stickiness policy with session lifetimes controlled by the browser (user-agent) or a specified expiration period. This policy can be associated only with HTTP/HTTPS listeners." }, { "PolicyAttributeTypeDescriptions": [ . . . ], "PolicyTypeName": "SSLNegotiationPolicyType", "Description": "Listener policy that defines the ciphers and protocols that will be accepted by the load balancer. This policy can be associated only with HTTPS/SSL listeners." }, { "PolicyAttributeTypeDescriptions": [ { "Cardinality": "ONE_OR_MORE", "AttributeName": "PublicKeyPolicyName", "AttributeType": "PolicyName" } ], "PolicyTypeName": "BackendServerAuthenticationPolicyType", "Description": "Policy that controls authentication to back-end server(s) and contains one or more policies, such as an instance of a PublicKeyPolicyType. This policy can be associated only with back-end servers that are using HTTPS/SSL." } ] }
PowerShell
Tools for PowerShell

例 1: この例では、Elastic Load Balancing でサポートされているポリシータイプを取得します。

Get-ELBLoadBalancerPolicyType

出力:

Description PolicyAttributeTypeDescriptions PolicyTypeName ----------- ------------------------------- -------------- Stickiness policy with session lifet... {CookieExpirationPeriod} LBCookieStickinessPolicyType Policy that controls authentication ... {PublicKeyPolicyName} BackendServerAuthenticationPolicyType Listener policy that defines the cip... {Protocol-SSLv2, Protocol-TLSv1, Pro... SSLNegotiationPolicyType Policy containing a list of public k... {PublicKey} PublicKeyPolicyType Stickiness policy with session lifet... {CookieName} AppCookieStickinessPolicyType Policy that controls whether to incl... {ProxyProtocol} ProxyProtocolPolicyType

例 2: この例では、指定されたポリシータイプを記述します。

Get-ELBLoadBalancerPolicyType -PolicyTypeName ProxyProtocolPolicyType

出力:

Description PolicyAttributeTypeDescriptions PolicyTypeName ----------- ------------------------------- -------------- Policy that controls whether to incl... {ProxyProtocol} ProxyProtocolPolicyType

例 3: この例では、指定されたポリシータイプの詳細な説明を表示します。

(Get-ELBLoadBalancerPolicyType -PolicyTypeName).Description

出力:

Policy that controls whether to include the IP address and port of the originating request for TCP messages. This policy operates on TCP/SSL listeners only
  • API の詳細については、AWS Tools for PowerShell 「 コマンドレットリファレンス」のDescribeLoadBalancerPolicyTypes」を参照してください。