diff --git a/lib/fog/aws/models/elb/load_balancer.rb b/lib/fog/aws/models/elb/load_balancer.rb index f0820806b..3041c0517 100644 --- a/lib/fog/aws/models/elb/load_balancer.rb +++ b/lib/fog/aws/models/elb/load_balancer.rb @@ -11,6 +11,7 @@ module Fog attribute :dns_name, :aliases => 'DNSName' attribute :health_check, :aliases => 'HealthCheck' attribute :instances, :aliases => 'Instances' + attribute :source_group, :aliases => 'SourceSecurityGroup' def initialize(attributes={}) attributes[:availability_zones] ||= %w(us-east-1a us-east-1b us-east-1c us-east-1d) diff --git a/lib/fog/aws/parsers/elb/describe_load_balancers.rb b/lib/fog/aws/parsers/elb/describe_load_balancers.rb index 1025b29d5..8efbfa641 100644 --- a/lib/fog/aws/parsers/elb/describe_load_balancers.rb +++ b/lib/fog/aws/parsers/elb/describe_load_balancers.rb @@ -14,7 +14,7 @@ module Fog end def reset_load_balancer - @load_balancer = { 'ListenerDescriptions' => [], 'Instances' => [], 'AvailabilityZones' => [], 'Policies' => {'AppCookieStickinessPolicies' => [], 'LBCookieStickinessPolicies' => [] }, 'HealthCheck' => {} } + @load_balancer = { 'ListenerDescriptions' => [], 'Instances' => [], 'AvailabilityZones' => [], 'Policies' => {'AppCookieStickinessPolicies' => [], 'LBCookieStickinessPolicies' => [] }, 'HealthCheck' => {}, 'SourceSecurityGroup' => {} } end def reset_listener_description @@ -66,7 +66,7 @@ module Fog reset_load_balancer end - when 'LoadBalancerName', 'DNSName' + when 'CanonicalHostedZoneName', 'CanonicalHostedZoneNameID', 'LoadBalancerName', 'DNSName' @load_balancer[name] = value when 'CreatedTime' @load_balancer[name] = Time.parse(value) @@ -95,6 +95,9 @@ module Fog when 'LBCookieStickinessPolicies' @in_lb_cookies = false + when 'OwnerAlias', 'GroupName' + @load_balancer['SourceSecurityGroup'][name] = value + when 'Interval', 'HealthyThreshold', 'Timeout', 'UnhealthyThreshold' @load_balancer['HealthCheck'][name] = value.to_i when 'Target' diff --git a/lib/fog/aws/requests/elb/describe_load_balancers.rb b/lib/fog/aws/requests/elb/describe_load_balancers.rb index 1560611c6..a828c9961 100644 --- a/lib/fog/aws/requests/elb/describe_load_balancers.rb +++ b/lib/fog/aws/requests/elb/describe_load_balancers.rb @@ -18,6 +18,8 @@ module Fog # * 'DescribeLoadBalancersResult'<~Hash>: # * 'LoadBalancerDescriptions'<~Array> # * 'AvailabilityZones'<~Array> - list of availability zones covered by this load balancer + # * 'CanonicalHostedZoneName'<~String> - name of the Route 53 hosted zone associated with the load balancer + # * 'CanonicalHostedZoneNameID'<~String> - ID of the Route 53 hosted zone associated with the load balancer # * 'CreatedTime'<~Time> - time load balancer was created # * 'DNSName'<~String> - external DNS name of load balancer # * 'HealthCheck'<~Hash>: @@ -37,6 +39,9 @@ module Fog # * 'Policies'<~Hash>: # * 'LBCookieStickinessPolicies'<~Array> - list of Load Balancer Generated Cookie Stickiness policies for the LoadBalancer # * 'AppCookieStickinessPolicies'<~Array> - list of Application Generated Cookie Stickiness policies for the LoadBalancer + # * 'SourceSecurityGroup'<~Hash>: + # * 'GroupName'<~String> - Name of the source security group to use with inbound security group rules + # * 'OwnerAlias'<~String> - Owner of the source security group def describe_load_balancers(lb_name = []) params = AWS.indexed_param('LoadBalancerNames.member', [*lb_name]) request({ diff --git a/tests/aws/requests/elb/helper.rb b/tests/aws/requests/elb/helper.rb index ee5a944fa..7ee8dcfb1 100644 --- a/tests/aws/requests/elb/helper.rb +++ b/tests/aws/requests/elb/helper.rb @@ -8,6 +8,8 @@ class AWS LOAD_BALANCER = { "AvailabilityZones" => Array, + "CanonicalHostedZoneName" => String, + "CanonicalHostedZoneNameID" => String, "CreatedTime" => Time, "DNSName" => String, "HealthCheck" => {"HealthyThreshold" => Integer, "Timeout" => Integer, "UnhealthyThreshold" => Integer, "Interval" => Integer, "Target" => String}, @@ -15,6 +17,7 @@ class AWS "ListenerDescriptions" => Array, "LoadBalancerName" => String, "Policies" => {"LBCookieStickinessPolicies" => Array, "AppCookieStickinessPolicies" => Array}, + "SourceSecurityGroup" => {"GroupName" => String, "OwnerAlias" => String}, } CREATE_LOAD_BALANCER = BASIC.merge({