Skip to main content

load_balancer_policies

Creates, updates, deletes, gets or lists a load_balancer_policies resource.

Overview

Nameload_balancer_policies
TypeResource
Idaws.elb.load_balancer_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
policy_attribute_descriptionsstringThe policy attributes.
policy_namestringThe name of the policy.
policy_type_namestringThe name of the policy type.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_load_balancer_policiesselectregionLoadBalancerName, PolicyNamesDescribes the specified policies. If you specify a load balancer name, the action returns the descriptions of all policies created for the load balancer. If you specify a policy name associated with your load balancer, the action returns the description of that policy. If you don't specify a load balancer name, the action returns descriptions of the specified sample policies, or descriptions of all sample policies. The names of the sample policies have the ELBSample- prefix.
create_load_balancer_policyinsertLoadBalancerName, PolicyName, PolicyTypeName, regionPolicyAttributesCreates 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.
set_load_balancer_policies_for_backend_serverupdateLoadBalancerName, InstancePort, PolicyNames, regionReplaces the set of policies associated with the specified port on which the EC2 instance is listening with a new set of policies. At this time, only the back-end server authentication policy type can be applied to the instance ports; this policy type is composed of multiple public key policies. Each time you use SetLoadBalancerPoliciesForBackendServer to enable the policies, use the PolicyNames parameter to list the policies that you want to enable. You can use DescribeLoadBalancers or DescribeLoadBalancerPolicies to verify that the policy is associated with the EC2 instance. For more information about enabling back-end instance authentication, see Configure Back-end Instance Authentication in the Classic Load Balancers Guide. For more information about Proxy Protocol, see Configure Proxy Protocol Support in the Classic Load Balancers Guide.
set_load_balancer_policies_of_listenerupdateLoadBalancerName, LoadBalancerPort, PolicyNames, regionReplaces the current set of policies for the specified load balancer port with the specified set of policies. To enable back-end server authentication, use SetLoadBalancerPoliciesForBackendServer. For more information about setting policies, see Update the SSL Negotiation Configuration, Duration-Based Session Stickiness, and Application-Controlled Session Stickiness in the Classic Load Balancers Guide.
delete_load_balancer_policydeleteLoadBalancerName, PolicyName, regionDeletes the specified policy from the specified load balancer. This policy must not be enabled for any listeners.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
InstancePortintegerThe port number associated with the EC2 instance.
LoadBalancerNamestringThe name of the load balancer.
LoadBalancerPortintegerThe external port of the load balancer.
PolicyNamestringThe name of the policy.
PolicyNamesarrayThe names of the policies. This list must include all policies to be enabled. If you omit a policy that is currently enabled, it is disabled. If the list is empty, all current policies are disabled.
PolicyTypeNamestringThe name of the base policy type. To get the list of policy types, use DescribeLoadBalancerPolicyTypes.
regionstringAWS region (default: us-east-1)
LoadBalancerNamestringThe name of the load balancer.
PolicyAttributesarrayThe policy attributes.
PolicyNamesarrayThe names of the policies.

SELECT examples

Describes the specified policies. If you specify a load balancer name, the action returns the descriptions of all policies created for the load balancer. If you specify a policy name associated with your load balancer, the action returns the description of that policy. If you don't specify a load balancer name, the action returns descriptions of the specified sample policies, or descriptions of all sample policies. The names of the sample policies have the ELBSample- prefix.

SELECT
policy_attribute_descriptions,
policy_name,
policy_type_name
FROM aws.elb.load_balancer_policies
WHERE region = '{{ region }}' -- required
AND LoadBalancerName = '{{ LoadBalancerName }}'
AND PolicyNames = '{{ PolicyNames }}'
;

INSERT examples

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.

INSERT INTO aws.elb.load_balancer_policies (
LoadBalancerName,
PolicyName,
PolicyTypeName,
region,
PolicyAttributes
)
SELECT
'{{ LoadBalancerName }}',
'{{ PolicyName }}',
'{{ PolicyTypeName }}',
'{{ region }}',
'{{ PolicyAttributes }}'
RETURNING
line_items
;

UPDATE examples

Replaces the set of policies associated with the specified port on which the EC2 instance is listening with a new set of policies. At this time, only the back-end server authentication policy type can be applied to the instance ports; this policy type is composed of multiple public key policies. Each time you use SetLoadBalancerPoliciesForBackendServer to enable the policies, use the PolicyNames parameter to list the policies that you want to enable. You can use DescribeLoadBalancers or DescribeLoadBalancerPolicies to verify that the policy is associated with the EC2 instance. For more information about enabling back-end instance authentication, see Configure Back-end Instance Authentication in the Classic Load Balancers Guide. For more information about Proxy Protocol, see Configure Proxy Protocol Support in the Classic Load Balancers Guide.

UPDATE aws.elb.load_balancer_policies
SET
-- No updatable properties
WHERE
LoadBalancerName = '{{ LoadBalancerName }}' --required
AND InstancePort = '{{ InstancePort }}' --required
AND PolicyNames = '{{ PolicyNames }}' --required
AND region = '{{ region }}' --required
RETURNING
line_items;

DELETE examples

Deletes the specified policy from the specified load balancer. This policy must not be enabled for any listeners.

DELETE FROM aws.elb.load_balancer_policies
WHERE LoadBalancerName = '{{ LoadBalancerName }}' --required
AND PolicyName = '{{ PolicyName }}' --required
AND region = '{{ region }}' --required
;