AWS CloudFormation
User Guide (API Version 2010-05-15)
AWS 服务或AWS文档中描述的功能,可能因地区/位置而异。请点击 Amazon AWS 入门,可查看中国地区的具体差异

ElasticLoadBalancing 策略类型

ElasticLoadBalancing 策略类型是 AWS::ElasticLoadBalancing::LoadBalancer 资源的嵌入式属性。通过在侦听器的 PolicyNames 属性中引用策略的名称,将策略与侦听器关联。

语法

JSON

{ "Attributes" : [ { "Name" : String, "Value" : String }, ... ], "InstancePorts" : [ String, ... ], "LoadBalancerPorts" : [ String, ... ], "PolicyName" : String, "PolicyType" : String }

YAML

Attributes: - "Name" : String "Value" : String InstancePorts: - 字符串 LoadBalancerPorts: - 字符串 PolicyName: String PolicyType: String

属性

Attributes

该策略的任意属性列表。如果您不需要指定任何策略属性,则指定空列表 ([])。

Required: Yes

类型:JSON 名称–值对列表。

InstancePorts

该策略的实例端口列表。这些是与后端服务器关联的端口。

Required: No

类型:字符串列表

LoadBalancerPorts

该策略的外部负载均衡器端口列表。

必填:仅针对某些策略。有关更多信息,请参阅 Elastic Load Balancing 开发人员指南

类型:字符串列表

PolicyName

对负载均衡器具有唯一性的策略名称。

Required: Yes

类型:字符串

PolicyType

该策略的策略类型名称。该参数必须为 Elastic Load Balancing 的 DescribeLoadBalancerPolicyTypes 报告的类型之一。

Required: Yes

类型:字符串

示例

此示例介绍 Elastic Load Balancer 侦听器的策略节的代码段。

"Policies" : [ { "PolicyName" : "MySSLNegotiationPolicy", "PolicyType" : "SSLNegotiationPolicyType", "Attributes" : [ { "Name" : "Protocol-TLSv1", "Value" : "true" }, { "Name" : "Protocol-SSLv3", "Value" : "false" }, { "Name" : "DHE-RSA-AES256-SHA", "Value" : "true" } ] }, { "PolicyName" : "MyAppCookieStickinessPolicy", "PolicyType" : "AppCookieStickinessPolicyType", "Attributes" : [ { "Name" : "CookieName", "Value" : "MyCookie"} ] }, { "PolicyName" : "MyPublicKeyPolicy", "PolicyType" : "PublicKeyPolicyType", "Attributes" : [ { "Name" : "PublicKey", "Value" : { "Fn::Join" : [ "\n", [ "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDh/51Aohx5VrpmlfGHZCzciMBa", "fkHve+MQYYJcxmNUKMdsWnz9WtVfKxxWUU7Cfor4lorYmENGCG8FWqCoLDMFs7pN", "yGEtpsrlKhzZWtgY1d7eGrUrBil03bI90E2KW0j4qAwGYAC8xixOkNClicojeEz4", "f4rr3sUf+ZBSsuMEuwIDAQAB" ] ] } } ] }, { "PolicyName" : "MyBackendServerAuthenticationPolicy", "PolicyType" : "BackendServerAuthenticationPolicyType", "Attributes" : [ { "Name" : "PublicKeyPolicyName", "Value" : "MyPublicKeyPolicy" } ], "InstancePorts" : [ "8443" ] } ]

此示例介绍使用代理协议的 Elastic Load Balancer 的策略节的代码段。

"Policies" : [{ "PolicyName" : "EnableProxyProtocol", "PolicyType" : "ProxyProtocolPolicyType", "Attributes" : [{ "Name" : "ProxyProtocol", "Value" : "true" }], "InstancePorts" : [{"Ref" : "WebServerPort"}] }]

在下面的代码段中,负载均衡器使用预定义的安全策略。这些预定义的安全策略由 Elastic Load Balancing 提供。有关更多信息,请参阅 Elastic Load Balancing 用户指南 中的 SSL 安全策略

"Policies" : [{ "PolicyName" : "ELBSecurityPolicyName", "PolicyType" : "SSLNegotiationPolicyType", "Attributes" : [{ "Name" : "Reference-Security-Policy", "Value" : "ELBSecurityPolicy-2014-10" }] }]

另请参阅

本页内容: