Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
Merge 78aecc1 into 518879d
Browse files Browse the repository at this point in the history
  • Loading branch information
ynuyasha committed Jan 24, 2020
2 parents 518879d + 78aecc1 commit 71e0c9c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/terraforming/resource/route_table.rb
Expand Up @@ -76,6 +76,7 @@ def route_attributes_of(route)
attributes = {
"route.#{hashcode}.cidr_block" => route.destination_cidr_block.to_s,
"route.#{hashcode}.gateway_id" => route.gateway_id.to_s,
"route.#{hashcode}.nat_gateway_id" => route.nat_gateway_id.to_s,
"route.#{hashcode}.instance_id" => route.instance_id.to_s,
"route.#{hashcode}.network_interface_id" => route.network_interface_id.to_s,
"route.#{hashcode}.vpc_peering_connection_id" => route.vpc_peering_connection_id.to_s
Expand Down
3 changes: 3 additions & 0 deletions lib/terraforming/template/tf/route_table.erb
Expand Up @@ -8,6 +8,9 @@ resource "aws_route_table" "<%= module_name_of(route_table) %>" {
<% if route.gateway_id -%>
gateway_id = "<%= route.gateway_id %>"
<% end -%>
<% if route.nat_gateway_id -%>
nat_gateway_id = "<%= route.nat_gateway_id %>"
<% end -%>
<% if route.instance_id -%>
instance_id = "<%= route.instance_id %>"
<% end -%>
Expand Down
25 changes: 24 additions & 1 deletion spec/lib/terraforming/resource/route_table_spec.rb
Expand Up @@ -52,6 +52,17 @@ module Resource
network_interface_id: nil,
vpc_peering_connection_id: 'pcx-c56789de',
state: 'active'
},
{
destination_cidr_block: '192.168.3.0/24',
destination_prefix_list_id: nil,
gateway_id: nil,
nat_gateway_id: 'nat-0a123456789012a3b',
instance_id: nil,
instance_owner_id: nil,
network_interface_id: nil,
vpc_peering_connection_id: nil,
state: 'active'
}
],
associations: [
Expand Down Expand Up @@ -151,6 +162,11 @@ module Resource
vpc_peering_connection_id = "pcx-c56789de"
}
route {
cidr_block = "192.168.3.0/24"
nat_gateway_id = "nat-0a123456789012a3b"
}
propagating_vgws = ["vgw-1a4j20b"]
tags {
Expand Down Expand Up @@ -207,7 +223,14 @@ module Resource
"route.2351420441.instance_id" => "",
"route.2351420441.network_interface_id" => "",
"route.2351420441.vpc_peering_connection_id" => "pcx-c56789de",


"route.3152305367.cidr_block" => "192.168.3.0/24",
"route.3152305367.gateway_id" => "",
"route.3152305367.nat_gateway_id" => "nat-0a123456789012a3b",
"route.3152305367.instance_id" => "",
"route.3152305367.network_interface_id" => "",
"route.3152305367.vpc_peering_connection_id" => "",

"propagating_vgws.#" => "1",
"propagating_vgws.772379535" => "vgw-1a4j20b"
}
Expand Down

0 comments on commit 71e0c9c

Please sign in to comment.