ElasticLoadBalancing / Client / set_load_balancer_policies_of_listener

set_load_balancer_policies_of_listener#

ElasticLoadBalancing.Client.set_load_balancer_policies_of_listener(**kwargs)#

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.

See also: AWS API Documentation

Request Syntax

response = client.set_load_balancer_policies_of_listener(
    LoadBalancerName='string',
    LoadBalancerPort=123,
    PolicyNames=[
        'string',
    ]
)
Parameters:
  • LoadBalancerName (string) –

    [REQUIRED]

    The name of the load balancer.

  • LoadBalancerPort (integer) –

    [REQUIRED]

    The external port of the load balancer.

  • PolicyNames (list) –

    [REQUIRED]

    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.

    • (string) –

Return type:

dict

Returns:

Response Syntax

{}

Response Structure

  • (dict) –

    Contains the output of SetLoadBalancePoliciesOfListener.

Exceptions

  • ElasticLoadBalancing.Client.exceptions.AccessPointNotFoundException

  • ElasticLoadBalancing.Client.exceptions.PolicyNotFoundException

  • ElasticLoadBalancing.Client.exceptions.ListenerNotFoundException

  • ElasticLoadBalancing.Client.exceptions.InvalidConfigurationRequestException

Examples

This example replaces the policies that are currently associated with the specified listener.

response = client.set_load_balancer_policies_of_listener(
    LoadBalancerName='my-load-balancer',
    LoadBalancerPort=80,
    PolicyNames=[
        'my-SSLNegotiation-policy',
    ],
)

print(response)

Expected Output:

{
    'ResponseMetadata': {
        '...': '...',
    },
}