diff --git a/lib/aws/ec2/route_table/route.rb b/lib/aws/ec2/route_table/route.rb index e9100708e37..4d16533703d 100644 --- a/lib/aws/ec2/route_table/route.rb +++ b/lib/aws/ec2/route_table/route.rb @@ -30,7 +30,9 @@ def initialize route_table, details @route_table = route_table - @destination_cidr_block = details.destination_cidr_block + if details[:destination_cidr_block] + @destination_cidr_block = details.destination_cidr_block + end if details[:gateway_id] @internet_gateway = InternetGateway.new( diff --git a/spec/aws/ec2/route_table_spec.rb b/spec/aws/ec2/route_table_spec.rb index 47d59f57204..ffb8f55865b 100644 --- a/spec/aws/ec2/route_table_spec.rb +++ b/spec/aws/ec2/route_table_spec.rb @@ -262,6 +262,12 @@ def stub_tags(resp, tags) :state => 'foo', } + route_set << { + :gateway_id => 'vpce-123', + :state => 'active', + :origin => 'CreateRoute', + } + routes = route_table.routes routes[0].destination_cidr_block.should == 'cidr-block-1' @@ -283,6 +289,10 @@ def stub_tags(resp, tags) routes[2].state.should == :foo routes[2].target.should == routes[2].network_interface + routes[3].target.should == InternetGateway.new('vpce-123', :config => config) + routes[3].state.should == :active + routes[3].origin.should == :create_route + end end