sgviz
sgviz copied to clipboard
Way to handle cases where there are SG from another Account or unspecified VPC
Right now sgviz fails with an exception if it sees a Security Group (SG) from another AWS account (ie from cross account peering) or from another VPC that is not specified on the command line.
It would be nice that if instead of failing, it would just treat the SG as an opaque handle or something so it shows it as a source/destination and moves on.
Here is an example exception when one of the source Security Groups is from another account:
sgviz generate --profile prod-core --output-path myvpc --region us-west-2
/Users/rberger/.rvm/gems/ruby-2.3.0/gems/gviz-0.3.5/lib/gviz/core.rb:33:in `block in node': undefined method `update' for "500772840855/sg-83335df8":String (NoMethodError)
from /Users/rberger/.rvm/gems/ruby-2.3.0/gems/gviz-0.3.5/lib/gviz/core.rb:31:in `tap'
from /Users/rberger/.rvm/gems/ruby-2.3.0/gems/gviz-0.3.5/lib/gviz/core.rb:31:in `node'
from /Users/rberger/work/omnypay/tools/sgviz/lib/sgviz/generator.rb:115:in `block (4 levels) in generate'
from /Users/rberger/work/omnypay/tools/sgviz/lib/sgviz/generator.rb:111:in `each'
from /Users/rberger/work/omnypay/tools/sgviz/lib/sgviz/generator.rb:111:in `block (3 levels) in generate'
from /Users/rberger/work/omnypay/tools/sgviz/lib/sgviz/generator.rb:92:in `each'
from /Users/rberger/work/omnypay/tools/sgviz/lib/sgviz/generator.rb:92:in `block (2 levels) in generate'
from /Users/rberger/work/omnypay/tools/sgviz/lib/sgviz/generator.rb:34:in `each'
from /Users/rberger/work/omnypay/tools/sgviz/lib/sgviz/generator.rb:34:in `block in generate'
from /Users/rberger/work/omnypay/tools/sgviz/lib/sgviz/generator.rb:33:in `each'
from /Users/rberger/work/omnypay/tools/sgviz/lib/sgviz/generator.rb:33:in `generate'
from /Users/rberger/work/omnypay/tools/sgviz/lib/sgviz/cli.rb:71:in `generate'
from /Users/rberger/.rvm/gems/ruby-2.3.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
from /Users/rberger/.rvm/gems/ruby-2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/rberger/.rvm/gems/ruby-2.3.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
from /Users/rberger/.rvm/gems/ruby-2.3.0/gems/thor-0.19.4/lib/thor/base.rb:444:in `start'
from /Users/rberger/.rvm/gems/ruby-2.3.0/gems/sgviz-0.0.2/bin/sgviz:5:in `<top (required)>'
from /Users/rberger/.rvm/gems/ruby-2.3.0/bin/sgviz:23:in `load'
from /Users/rberger/.rvm/gems/ruby-2.3.0/bin/sgviz:23:in `<main>'
from /Users/rberger/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
from /Users/rberger/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'