From 0185430dabd4306e7d6de5f1224d92f2c231068c Mon Sep 17 00:00:00 2001 From: David Bartley Date: Mon, 6 Jul 2015 00:37:24 -0700 Subject: [PATCH] DestinationCidrBlock isn't returned for VPC endpoint routes. --- lib/aws/ec2/route_table/route.rb | 4 +++- spec/aws/ec2/route_table_spec.rb | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) 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