文档 AWS SDK 示例 GitHub 存储库中还有更多 S AWS DK 示例
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
将 DescribeLoadBalancerPolicyTypes
与 CLI 配合使用
以下代码示例演示如何使用 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." } ] }
-
有关 API 的详细信息,请参阅AWS CLI 命令参考DescribeLoadBalancerPolicyTypes
中的。
-
- PowerShell
-
- 用于 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 Cmdlet 参考DescribeLoadBalancerPolicyTypes中的。
-
DescribeLoadBalancerPolicies
DescribeLoadBalancers