load_balancer_policies
Creates, updates, deletes, gets or lists a load_balancer_policies resource.
Overview
| Name | load_balancer_policies |
| Type | Resource |
| Id | aws.elb.load_balancer_policies |
Fields
The following fields are returned by SELECT queries:
- describe_load_balancer_policies
| Name | Datatype | Description |
|---|---|---|
policy_attribute_descriptions | string | The policy attributes. |
policy_name | string | The name of the policy. |
policy_type_name | string | The name of the policy type. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_load_balancer_policies | select | region | LoadBalancerName, PolicyNames | 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. |
create_load_balancer_policy | insert | LoadBalancerName, PolicyName, PolicyTypeName, region | PolicyAttributes | 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. |
set_load_balancer_policies_for_backend_server | update | LoadBalancerName, InstancePort, PolicyNames, region | 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. | |
set_load_balancer_policies_of_listener | update | LoadBalancerName, LoadBalancerPort, PolicyNames, region | Replaces 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_policy | delete | LoadBalancerName, PolicyName, region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
InstancePort | integer | The port number associated with the EC2 instance. |
LoadBalancerName | string | The name of the load balancer. |
LoadBalancerPort | integer | The external port of the load balancer. |
PolicyName | string | The name of the policy. |
PolicyNames | array | The 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. |
PolicyTypeName | string | The name of the base policy type. To get the list of policy types, use DescribeLoadBalancerPolicyTypes. |
region | string | AWS region (default: us-east-1) |
LoadBalancerName | string | The name of the load balancer. |
PolicyAttributes | array | The policy attributes. |
PolicyNames | array | The names of the policies. |
SELECT examples
- describe_load_balancer_policies
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
- create_load_balancer_policy
- Manifest
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
;
# Description fields are for documentation purposes
- name: load_balancer_policies
props:
- name: LoadBalancerName
value: "{{ LoadBalancerName }}"
description: Required parameter for the load_balancer_policies resource.
- name: PolicyName
value: "{{ PolicyName }}"
description: Required parameter for the load_balancer_policies resource.
- name: PolicyTypeName
value: "{{ PolicyTypeName }}"
description: Required parameter for the load_balancer_policies resource.
- name: region
value: "{{ region }}"
description: Required parameter for the load_balancer_policies resource.
- name: PolicyAttributes
value: "{{ PolicyAttributes }}"
description: The policy attributes.
description: The policy attributes.
UPDATE examples
- set_load_balancer_policies_for_backend_server
- set_load_balancer_policies_of_listener
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;
Replaces 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.
UPDATE aws.elb.load_balancer_policies
SET
-- No updatable properties
WHERE
LoadBalancerName = '{{ LoadBalancerName }}' --required
AND LoadBalancerPort = '{{ LoadBalancerPort }}' --required
AND PolicyNames = '{{ PolicyNames }}' --required
AND region = '{{ region }}' --required
RETURNING
line_items;
DELETE examples
- delete_load_balancer_policy
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
;