CreateLoadBalancerPolicy - Elastic Load Balancing

CreateLoadBalancerPolicy

Creates a policy with the specified attributes for the specified load balancer.

Policies are settings that are saved for your load balancer and that can be applied to the listener or the application server, depending on the policy type.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

LoadBalancerName

The name of the load balancer.

Type: String

Required: Yes

PolicyAttributes.member.N

The policy attributes.

Type: Array of PolicyAttribute objects

Required: No

PolicyName

The name of the load balancer policy to be created. This name must be unique within the set of policies for this load balancer.

Type: String

Required: Yes

PolicyTypeName

The name of the base policy type. To get the list of policy types, use DescribeLoadBalancerPolicyTypes.

Type: String

Required: Yes

Errors

For information about the errors that are common to all actions, see Common Errors.

DuplicatePolicyName

A policy with the specified name already exists for this load balancer.

HTTP Status Code: 400

InvalidConfigurationRequest

The requested configuration change is not valid.

HTTP Status Code: 409

LoadBalancerNotFound

The specified load balancer does not exist.

HTTP Status Code: 400

PolicyTypeNotFound

One or more of the specified policy types do not exist.

HTTP Status Code: 400

TooManyPolicies

The quota for the number of policies for this load balancer has been reached.

HTTP Status Code: 400

Examples

Enable proxy protocol

This example creates a policy that enables proxy protocol on the specified load balancer.

Sample Request

https://elasticloadbalancing.amazonaws.com/?Action=CreateLoadBalancerPolicy &LoadBalancerName=my-loadbalancer &PolicyName=EnableProxyProtocol &PolicyTypeName=ProxyProtocolPolicyType &PolicyAttributes.member.1.AttributeName=ProxyProtocol &PolicyAttributes.member.1.AttributeValue=true &Version=2012-06-01 &AUTHPARAMS

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: