Associates, updates, or disables a policy with a listener on the LoadBalancer. You can associate multiple policies with a listener.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
The name associated with the LoadBalancer. The name must be unique within the client AWS account. |
|
|
Required |
The external port of the LoadBalancer with which this policy applies to. |
|
|
Required |
List of policies to be associated with the listener. Currently this list can have at most one policy. If the list is empty, the current policy is removed from the listener. Pass a string for a single value, or an indexed array for multiple values. |
|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
Assign a policy to a load balancer listener.
To assign a policy to a load balancer, you must:
- Create a policy using either
create_app_cookie_stickiness_policy()
orcreate_lb_cookie_stickiness_policy()
. - Assign the policy to the load balancer with
set_load_balancer_policies_of_listener()
. - Remove them with
delete_load_balancer_policy()
.
$elb = new AmazonELB(); $response = $elb->set_load_balancer_policies_of_listener('my-load-balancer', 80, 'lb-cookie-policy'); // Success? var_dump($response->isOK());Result:
bool(true)
Related Methods
Source
Method defined in services/elb.class.php | Toggle source view (13 lines) | View on GitHub