Permalink
Browse files

Support multiple private zones w/ same zone name

Multiple private zones with the same zone name (i.e. for testing, staging,
production) are exported to the same file when using the `--split`
option.

By adding the `vpc_id` to the `route_file_basename`, multiple private
zones with the same zone name can be correctly exported to separate
files when using the `--split` option.
  • Loading branch information...
kforsthoevel committed Jun 29, 2016
1 parent 8e2f1b4 commit 16f98d69108c2fbced6283e7582bd79b13c7a005
Showing with 2 additions and 1 deletion.
  1. +2 −1 bin/roadwork
@@ -111,7 +111,8 @@ begin
client.export do |exported, converter|
exported[:hosted_zones].each do |zone|
route_file_basename = zone[:name].sub(/\.\Z/, '')
route_file_basename << '.private' unless zone[:vpcs].empty?
route_file_basename << ".private" unless zone[:vpcs].empty?
route_file_basename << ".#{zone[:vpcs].first.vpc_id}" unless zone[:vpcs].empty?
route_file_basename << '.route'

route_file = File.join(File.dirname(output_file), route_file_basename)

0 comments on commit 16f98d6

Please sign in to comment.