This module provides an interface to the Elastic Compute Cloud (EC2) load balancing service from AWS.
Init method to create a new connection to EC2 Load Balancing Service.
Note
The region argument is overridden by the region specified in the boto configuration file.
Applies security groups to the load balancer. Applying security groups that are already registered with the Load Balancer has no effect.
Parameters: |
|
---|---|
Return type: | List of strings |
Returns: | An updated list of security groups for this Load Balancer. |
Attaches load balancer to one or more subnets. Attaching subnets that are already registered with the Load Balancer has no effect.
Parameters: |
|
---|---|
Return type: | List of strings |
Returns: | An updated list of subnets for this Load Balancer. |
Define a health check for the EndPoints.
Parameters: |
|
---|---|
Return type: | |
Returns: | The updated boto.ec2.elb.healthcheck.HealthCheck |
Generates a stickiness policy with sticky session lifetimes that follow that of an application-generated cookie. This policy can only be associated with HTTP listeners.
This policy is similar to the policy created by CreateLBCookieStickinessPolicy, except that the lifetime of the special Elastic Load Balancing cookie follows the lifetime of the application-generated cookie specified in the policy configuration. The load balancer only inserts a new stickiness cookie when the application response includes a new application cookie.
If the application cookie is explicitly removed or expires, the session stops being sticky until a new application cookie is issued.
Generates a stickiness policy with sticky session lifetimes controlled by the lifetime of the browser (user-agent) or a specified expiration period. This policy can only be associated only with HTTP listeners.
When a load balancer implements this policy, the load balancer uses a special cookie to track the backend server instance for each request. When the load balancer receives a request, it first checks to see if this cookie is present in the request. If so, the load balancer sends the request to the application server specified in the cookie. If not, the load balancer sends the request to a server that is chosen based on the existing load balancing algorithm.
A cookie is inserted into the response for binding subsequent requests from the same user to that server. The validity of the cookie is based on the cookie expiration time, which is specified in the policy configuration.
Create a new load balancer for your account. By default the load balancer will be created in EC2. To create a load balancer inside a VPC, parameter zones must be set to None and subnets must not be None. The load balancer will be automatically created under the VPC that contains the subnet(s) specified.
Parameters: |
|
---|---|
Return type: | |
Returns: | The newly created boto.ec2.elb.loadbalancer.LoadBalancer |
Creates a Listener (or group of listeners) for an existing Load Balancer
Parameters: |
|
---|---|
Returns: | The status of the request |
Deletes a policy from the LoadBalancer. The specified policy must not be enabled for any listeners.
Delete a Load Balancer from your account.
Parameters: | name (string) – The name of the Load Balancer to delete |
---|
Deletes a load balancer listener (or group of listeners)
Parameters: |
|
---|---|
Returns: | The status of the request |
Remove Instances from an existing Load Balancer.
Parameters: |
|
---|---|
Return type: | List of strings |
Returns: | An updated list of instances for this Load Balancer. |
Get current state of all Instances registered to an Load Balancer.
Parameters: |
|
---|---|
Return type: | |
Returns: | list of state info for instances in this Load Balancer. |
Detaches load balancer from one or more subnets.
Parameters: |
|
---|---|
Return type: | List of strings |
Returns: | An updated list of subnets for this Load Balancer. |
Remove availability zones from an existing Load Balancer. All zones must be in the same region as the Load Balancer. Removing zones that are not registered with the Load Balancer has no effect. You cannot remove all zones from an Load Balancer.
Parameters: |
|
---|---|
Return type: | List of strings |
Returns: | An updated list of zones for this Load Balancer. |
Add availability zones to an existing Load Balancer All zones must be in the same region as the Load Balancer Adding zones that are already registered with the Load Balancer has no effect.
Parameters: |
|
---|---|
Return type: | List of strings |
Returns: | An updated list of zones for this Load Balancer. |
Retrieve all load balancers associated with your account.
Parameters: | load_balancer_names (list) – An optional list of load balancer names. |
---|---|
Return type: | boto.resultset.ResultSet |
Returns: | A ResultSet containing instances of boto.ec2.elb.loadbalancer.LoadBalancer |
Add new Instances to an existing Load Balancer.
Parameters: |
|
---|---|
Return type: | List of strings |
Returns: | An updated list of instances for this Load Balancer. |
Sets the certificate that terminates the specified listener’s SSL connections. The specified certificate replaces any prior certificate that was used on the same LoadBalancer and port.
Associates, updates, or disables a policy with a listener on the load balancer. Currently only zero (0) or one (1) policy can be associated with a listener.
Given a valid region name, return a boto.ec2.elb.ELBConnection.
Parameters: | region_name (str) – The name of the region to connect to. |
---|---|
Return type: | boto.ec2.ELBConnection or None |
Returns: | A connection to the given region, or None if an invalid region name is given |
Get all available regions for the ELB service.
Return type: | list |
---|---|
Returns: | A list of boto.RegionInfo instances |
Represents an EC2 Access Point Health Check. See Configuring a Health Check for a walkthrough on configuring load balancer health checks.
Variables: |
|
---|
In the case where you have accessed an existing health check on a load balancer, this method applies this instance’s health check values to the load balancer it is attached to.
Note
This method will not do anything if the access_point attribute isn’t set, as is the case with a newly instantiated HealthCheck instance.
Represents the state of an EC2 Load Balancer Instance
Variables: |
|
---|
Represents an EC2 Load Balancer.
Variables: |
|
---|
Applies security groups to the load balancer. Applying security groups that are already registered with the Load Balancer has no effect.
Parameters: | security_groups (string or List of strings) – The name of the security group(s) to add. |
---|
Attaches load balancer to one or more subnets. Attaching subnets that are already registered with the Load Balancer has no effect.
Parameters: | subnets (string or List of strings) – The name of the subnet(s) to add. |
---|
Configures the health check behavior for the instances behind this load balancer. See Configuring a Health Check for a walkthrough.
Parameters: | health_check (boto.ec2.elb.healthcheck.HealthCheck) – A HealthCheck instance that tells the load balancer how to check its instances for health. |
---|
Delete this load balancer.
Deletes a policy from the LoadBalancer. The specified policy must not be enabled for any listeners.
Remove instances from this load balancer. Removing instances that are not registered with the load balancer has no effect.
Parameters: | instances (list) – List of instance IDs (strings) that you’d like to remove from this load balancer. |
---|
Detaches load balancer from one or more subnets.
Parameters: | subnets (string or List of strings) – The name of the subnet(s) to detach. |
---|
Disable availability zones from this Access Point.
Parameters: | zones (string or List of strings) – The name of the zone(s) to add. |
---|
Enable availability zones to this Access Point. All zones must be in the same region as the Access Point.
Parameters: | zones (string or List of strings) – The name of the zone(s) to add. |
---|
Returns a list of boto.ec2.elb.instancestate.InstanceState objects, which show the health of the instances attached to this load balancer.
Return type: | list |
---|---|
Returns: | A list of InstanceState instances, representing the instances attached to this load balancer. |
Adds instances to this load balancer. All instances must be in the same region as the load balancer. Adding endpoints that are already registered with the load balancer has no effect.
Parameters: | instances (list) – List of instance IDs (strings) that you’d like to add to this load balancer. |
---|