@@ -59,13 +59,13 @@ def self.load_balancer_to_hash(region, load_balancer)
5959 end
6060 health_check = { }
6161 unless load_balancer . health_check . nil?
62- health_check = {
63- 'healthy_threshold' => load_balancer . health_check . healthy_threshold ,
64- 'interval' => load_balancer . health_check . interval ,
65- 'target' => load_balancer . health_check . target ,
66- 'timeout' => load_balancer . health_check . timeout ,
67- 'unhealthy_threshold' => load_balancer . health_check . unhealthy_threshold ,
68- }
62+ health_check = {
63+ 'healthy_threshold' => load_balancer . health_check . healthy_threshold ,
64+ 'interval' => load_balancer . health_check . interval ,
65+ 'target' => load_balancer . health_check . target ,
66+ 'timeout' => load_balancer . health_check . timeout ,
67+ 'unhealthy_threshold' => load_balancer . health_check . unhealthy_threshold ,
68+ }
6969 end
7070 tag_response = elb_client ( region ) . describe_tags (
7171 load_balancer_names : [ load_balancer . load_balancer_name ]
@@ -153,7 +153,7 @@ def create
153153 @property_hash [ :ensure ] = :present
154154
155155 if ! resource [ :health_check ] . nil?
156- self . health_check = resource [ :health_check ]
156+ self . health_check = resource [ :health_check ]
157157 end
158158
159159 instances = resource [ :instances ]
@@ -287,6 +287,34 @@ def health_check=(value)
287287 } )
288288 end
289289
290+ def health_check = ( value )
291+ elb = elb_client ( resource [ :region ] )
292+ elb . configure_health_check ( {
293+ load_balancer_name : name ,
294+ health_check : {
295+ target : value [ 'target' ] ,
296+ interval : value [ 'interval' ] ,
297+ timeout : value [ 'timeout' ] ,
298+ unhealthy_threshold : value [ 'unhealthy_threshold' ] ,
299+ healthy_threshold : value [ 'healthy_threshold' ] ,
300+ } ,
301+ } )
302+ end
303+
304+ def health_check = ( value )
305+ elb = elb_client ( resource [ :region ] )
306+ elb . configure_health_check ( {
307+ load_balancer_name : name ,
308+ health_check : {
309+ target : value [ 'target' ] ,
310+ interval : value [ 'interval' ] ,
311+ timeout : value [ 'timeout' ] ,
312+ unhealthy_threshold : value [ 'unhealthy_threshold' ] ,
313+ healthy_threshold : value [ 'healthy_threshold' ] ,
314+ } ,
315+ } )
316+ end
317+
290318 def destroy
291319 Puppet . info ( "Destroying load balancer #{ name } in region #{ target_region } " )
292320 elb_client ( target_region ) . delete_load_balancer (
0 commit comments