1VM::EC2::ELB(3) User Contributed Perl Documentation VM::EC2::ELB(3)
2
3
4
6 VM::EC2::ELB -- Object describing an Elastic Load Balancer
7
9 use VM::EC2;
10
11 $ec2 = VM::EC2->new(...);
12 $lb = $ec2->create_load_balancer(%args);
13 or
14 $lb = $ec2->describe_load_balancers(-load_balancer_name=>'my-lb');
15
16 @zones = $lb->AvailabilityZones;
17 $created = $lb->CreatedTime;
18 $dns_name = $lb->DNSName;
19 $health_check = $lb->HealthCheck;
20 @instances = $lb->Instances;
21 @list_desc = $lb->ListenerDescriptions;
22 $name = $lb->LoadBalancerName;
23 @policies_obj = $lb->Policies;
24 @policies = $lb->describe_policies(-policy_names=>'mypolicy');
25 $scheme = $lb->Scheme;
26 $sg_name = $lb->SourceSecurityGroup;
27 $success = $lb->create_load_balancer_listeners(%args);
28 $success = $lb->enable_availability_zones_for_load_balancer(@zones);
29 @list = $lb->register_instances_with_load_balancer(-instances => 'i-12345678');
30 $state = $lb->describe_instance_health(-instances => 'i-12345678')
31 $success = $lb->delete_load_balancer;
32
34 This object represents an Amazon Elastic Load Balancer and is returned
35 by VM::EC2->describe_load_balancers() and
36 VM::EC2->create_load_balancer(). In addition to methods to query the
37 ELB's attributes, there are methods that manage the ELB's lifecycle and
38 properties.
39
41 The following object methods are supported:
42
43 AvailabilityZones -- The enabled availability zones for the ELB in the
44 form of an array of L<VM::EC2::AvailabilityZone>
45 objects.
46 BackendServerDescriptions -- The backend server descriptions.
47 CreatedTime -- The creation date of the ELB.
48 DNSName -- The DNS name of the ELB.
49 HealthCheck -- The health check associated with the ELB in the
50 form of a L<VM::EC2::ELB::HealthCheck> object.
51 Instances -- The instances that the ELB points to, in the form
52 of an array of L<VM::EC2::Instance> objects.
53 ListenerDescriptions -- An array of L<VM::EC2::ELB::ListenerDescription>
54 objects.
55 LoadBalancerName -- The name of the ELB
56 Policies -- The policies of the ELB in the form of a
57 L<VM::EC2::ELB::Policies> object.
58 Scheme -- Specifies the type of ELB ('internal' is for VPC
59 only.)
60 SecurityGroups -- The security groups the ELB is a member of (VPC
61 only) in the form of L<VM::EC2::SecurityGroup>
62 objects.
63 SourceSecurityGroup -- The security group that the ELB is a member of
64 Subnets -- Provides an array of VPC subnet objects
65 (L<VM::EC2::VPC::Subnet>) that the ELB is part of.
66 VPCId -- Provides the ID of the VPC attached to the ELB.
67
68 "Unimplemented/untested" object methods related to Route 53 (return raw
69 data/ data structures):
70
71 CanonicalHostedZoneName -- The name of the Amazon Route 53 hosted zone that
72 is associated with the ELB.
73 CanonicalHostedZoneNameID -- The ID of the Amazon Route 53 hosted zone name
74 that is associated with the ELB.
75
76 The following convenience methods are supported;
77
78 active_policies -- Returns the policies that are actively in use by
79 the ELB in the form of L<VM::EC2::ELB::PolicyDescription>
80 objects.
81 all_policies -- Returns all policies that are associated with the
82 ELB in the form of L<VM::EC2::ELB::PolicyDescription>
83 objects.
84 listeners -- Provides the L<VM::EC2::ELB::Listener> objects
85 associated with the ELB
86
88 $success = $elb->delete_load_balancer =head2 $success = $elb->delete
89 This method deletes the ELB. Returns true on success.
90
91 $success =
92 $elb->create_app_cookie_stickiness_policy(-cookie_name=>$cookie_name,-policy_name=>$policy_name)
93 Generates a stickiness policy with sticky session lifetimes that follow
94 that of an application-generated cookie. This policy can be associated
95 only with HTTP/HTTPS listeners. Returns true on success.
96
97 $success =
98 $elb->create_lb_cookie_stickiness_policy(-cookie_expiration_period=>$secs,-policy_name=>$name)
99 Generates a stickiness policy with sticky session lifetimes controlled
100 by the lifetime of the browser (user-agent) or a specified expiration
101 period. This policy can be associated only with HTTP/HTTPS listeners.
102 Returns true on success.
103
104 $success =
105 $elb->create_load_balancer_listeners(-listeners=>\%listener_hash);
106 =head2 $success = $elb->create_listeners(\%listener_hash);
107 Creates one or more listeners on a ELB for the specified port. If a
108 listener with the given port does not already exist, it will be
109 created; otherwise, the properties of the new listener must match the
110 properties of the existing listener. Returns true on success.
111
112 The passed argument must either be a VM::EC2::ELB:Listener object (or
113 arrayref of objects) or a hash (or arrayref of hashes) containing the
114 following keys:
115
116 Protocol -- Value as one of: HTTP, HTTPS, TCP, or SSL
117 LoadBalancerPort -- Value in range 1-65535
118 InstancePort -- Value in range 1-65535
119 and optionally:
120 InstanceProtocol -- Value as one of: HTTP, HTTPS, TCP, or SSL
121 SSLCertificateId -- Certificate ID from AWS IAM certificate list
122
123 $success =
124 $elb->delete_load_balancer_listeners(-load_balancer_ports=>\@ports)
125 =head2 $success = $elb->delete_listeners(@ports)
126 Deletes listeners from the ELB for the specified port. Returns true on
127 success.
128
129 @zones =
130 $elb->disable_availability_zones_for_load_balancer(-zones=>\@zones)
131 =head2 @zones = $elb->disable_availability_zones(@zones) =head2 @zones
132 = $elb->disable_zones(@zones)
133 Removes the specified EC2 Availability Zones from the set of configured
134 Availability Zones for the ELB. Returns a series of
135 VM::EC2::AvailabilityZone objects now associated with the ELB.
136
137 @zones = $elb->enable_availability_zones_for_load_balancer(-zones=>\@zones)
138 =head2 @zones = $elb->enable_availability_zones(@zones) =head2 @zones =
139 $elb->enable_zones(@zones)
140 Adds the specified EC2 Availability Zones to the set of configured
141 Availability Zones for the ELB. Returns a series of
142 VM::EC2::AvailabilityZone objects now associated with the ELB.
143
144 @instance_ids =
145 $elb->register_instances_with_load_balancer(-instances=>\@instance_ids)
146 =head2 @instance_ids = $elb->register_instances(@instance_ids)
147 Adds new instances to the ELB. If the instance is in an availability
148 zone that is not registered with the ELB will be in the OutOfService
149 state. Once the zone is added to the ELB the instance will go into the
150 InService state. Returns an array of instance IDs now associated with
151 the ELB.
152
153 @instance_ids =
154 $elb->deregister_instances_from_load_balancer(-instances=>\@instance_ids)
155 =head2 @instance_ids = $elb->deregister_instances(@instance_ids)
156 Deregisters instances from the ELB. Once the instance is deregistered,
157 it will stop receiving traffic from the ELB. Returns an array of
158 instance IDs now associated with the ELB.
159
160 @states = $elb->describe_instance_health(-instances=>\@instance_ids) =head2
161 @states = $elb->describe_instance_health(@instance_ids)
162 Provides the current state of the instances of the specified
163 LoadBalancer. If no instances are specified, the state of all the
164 instances for the ELB is returned. Returns an array of
165 VM::EC2::ELB::InstanceState objects.
166
167 $success =
168 $elb->create_load_balancer_policy(-policy_name=>$name,-policy_type_name=>$type_name,-policy_attributes=>\@attrs)
169 =head2 $success =
170 $elb->create_policy(-policy_name=>$name,-policy_type_name=>$type_name,-policy_attributes=>\@attrs)
171 Creates a new policy that contains the necessary attributes depending
172 on the policy type. Policies are settings that are saved for your ELB
173 and that can be applied to the front-end listener, or the back-end
174 application server, depending on your policy type. Returns true on
175 success.
176
177 $success = $elb->delete_load_balancer_policy(-policy_name=>$policy_name)
178 =head2 $success = $elb->delete_policy($policy_name)
179 Deletes a policy from the ELB. The specified policy must not be
180 enabled for any listeners. Returns true on success.
181
183 $health_check =
184 $elb->configure_health_check(-healthy_threshold=>$cnt,-interval=>$secs,-target=>$target,-timeout=>$secs,-unhealthy_threshold=>$cnt)
185 This method configures the health check for a particular target
186 service.
187
188 -target must be in the format Protocol:Port[/PathToPing]:
189 - Valid Protocol types are: HTTP, HTTPS, TCP, SSL
190 - Port must be in range 0-65535
191 - PathToPing is only applicable to HTTP or HTTPS protocol
192 types and must be 1024 characters long or fewer.
193
194 ex: HTTP:80/index.html
195
196 $success =
197 $elb->create_policy(-policy_name=>$name,-policy_type_name=>$type_name)
198 Creates a new policy that contains the necessary attributes depending
199 on the policy type. Returns true on success.
200
201 $success =
202 $elb->set_load_balancer_listener_ssl_certificate(-port=>$port,-cert_id=>$cert_id)
203 Sets the certificate that terminates the specified listener's SSL
204 connections. The specified certificate replaces any prior certificate
205 that was used on the same ELB and port. Returns true on success.
206
207 $success =
208 $elb->set_load_balancer_policies_of_listener(-port=>$port,-policy_names=>\@names)
209 =head2 $success =
210 $elb->set_policies_of_listener(-port=>$port,-policy_names=>\@names)
211 Associates, updates, or disables a policy with a listener on the ELB.
212 Multiple policies may be associated with a listener. Returns true on
213 success.
214
215 @groups =
216 $elb->apply_security_groups_to_load_balancer(-security_groups=>\@groups)
217 =head2 @groups = $elb->apply_security_groups(@groups)
218 Associates one or more security groups with your ELB in VPC. The
219 provided security group IDs will override any currently applied
220 security groups. Returns a list of VM::EC2::SecurityGroup objects.
221
222 @subnets = $elb->attach_load_balancer_to_subnets(-subnets=>\@subnets)
223 =head2 @subnets = $elb->attach_to_subnets(@subnets)
224 Adds one or more subnets to the set of configured subnets for the ELB.
225 Returns a series of VM::EC2::VPC::Subnet objects corresponding to the
226 subnets the ELB is now attached to.
227
228 @subnets = $elb->detach_load_balancer_from_subnets(-subnets=>\@subnets)
229 =head2 @subnets = $elb->detach_from_subnets(@subnets)
230 Removes subnets from the set of configured subnets in the VPC for the
231 ELB. Returns a series of VM::EC2::VPC::Subnet objects corresponding to
232 the subnets the ELB is now attached to.
233
234 $success =
235 $elb->set_load_balancer_policies_for_backend_server(-port=>$port,-policy_names=>$names)
236 =head2 $success =
237 $elb->set_policies_for_backend_server(-port=>$port,-policy_names=>$names)
238 Replaces the current set of policies associated with a port on which
239 the back- end server is listening with a new set of policies. After the
240 policies have been created, they can be applied here as a list. At
241 this time, only the back- end server authentication policy type can be
242 applied to the back-end ports; this policy type is composed of multiple
243 public key policies. Returns true on success.
244
245 $success = $elb->add_tags({ Name => Value[, Name => Value,...]); =head2
246 $success = $elb->add_tags(\%tags);
247 Adds tags to the ELB. Up to ten tags can be applied.
248
250 $state = $lb->describe_instance_health(-instances=>\@instances) =head2
251 $state = $lb->describe_instance_health(@instances) =head2 $state =
252 $lb->describe_instance_health
253 Returns the current state of the instances registered with the ELB.
254
255 @policies = $lb->describe_load_balancer_policies(-policy_names=>\@names)
256 =head2 @policies = $lb->describe_load_balancer_policies;
258 When used in a string context, this object will interpolate the Elastic
259 Load Balancer Name.
260
262 VM::EC2 VM::EC2::Generic VM::EC2::ELB::HealthCheck
263 VM::EC2::ELB::ListenerDescription
264 VM::EC2::ELB::BackendServerDescription VM::EC2::ELB::Policies
265
267 Lance Kinley <lkinley@loyaltymethods.com>.
268
269 Copyright (c) 2012-2014 Loyalty Methods, Inc.
270
271 This package and its accompanying libraries is free software; you can
272 redistribute it and/or modify it under the terms of the GPL (either
273 version 1, or at your option, any later version) or the Artistic
274 License 2.0. Refer to LICENSE for the full license text. In addition,
275 please see DISCLAIMER.txt for disclaimers of warranty.
276
277
278
279perl v5.34.0 2022-01-21 VM::EC2::ELB(3)