:doc:`ElasticLoadBalancing <../../elb>` / Client / set_load_balancer_policies_of_listener

**************************************
set_load_balancer_policies_of_listener
**************************************



.. py:method:: 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 <https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/ssl-config-update.html>`__, `Duration-Based Session Stickiness <https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-duration>`__, and `Application-Controlled Session Stickiness <https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-application>`__ in the *Classic Load Balancers Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesOfListener>`_  


  **Request Syntax**
  ::

    response = client.set_load_balancer_policies_of_listener(
        LoadBalancerName='string',
        LoadBalancerPort=123,
        PolicyNames=[
            'string',
        ]
    )
    
  :type LoadBalancerName: string
  :param LoadBalancerName: **[REQUIRED]** 

    The name of the load balancer.

    

  
  :type LoadBalancerPort: integer
  :param LoadBalancerPort: **[REQUIRED]** 

    The external port of the load balancer.

    

  
  :type PolicyNames: list
  :param PolicyNames: **[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) --* 

    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 

      Contains the output of SetLoadBalancePoliciesOfListener.

      
  
  **Exceptions**
  
  *   :py:class:`ElasticLoadBalancing.Client.exceptions.AccessPointNotFoundException`

  
  *   :py:class:`ElasticLoadBalancing.Client.exceptions.PolicyNotFoundException`

  
  *   :py:class:`ElasticLoadBalancing.Client.exceptions.ListenerNotFoundException`

  
  *   :py:class:`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': {
            '...': '...',
        },
    }

  