dtan4 / terraforming

Export existing AWS resources to Terraform style (tf, tfstate) / No longer actively maintained
http://terraforming.dtan4.net/
MIT License
4.3k stars 659 forks source link

terraforming ecc - undefined method `endpoint' for nil:NilClass #468

Closed entscheidungsproblem closed 2 years ago

entscheidungsproblem commented 5 years ago

platform:

$ uname -a
Linux ubuntu-xenial 4.4.0-148-generic #174-Ubuntu SMP Tue May 7 12:20:14 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

ruby version:

$ ruby --version
ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]

terraforming version:

$ gem list | grep terraforming
terraforming (0.18.0)

executed command:

$ terraforming ecc
(erb):12:in `block in apply_template': undefined method `endpoint' for nil:NilClass (NoMethodError)
        from (erb):1:in `each'
        from (erb):1:in `apply_template'
        from /usr/lib/ruby/2.3.0/erb.rb:864:in `eval'
        from /usr/lib/ruby/2.3.0/erb.rb:864:in `result'
        from /var/lib/gems/2.3.0/gems/terraforming-0.18.0/lib/terraforming/util.rb:4:in `apply_template'
        from /var/lib/gems/2.3.0/gems/terraforming-0.18.0/lib/terraforming/resource/elasti_cache_cluster.rb:19:in `tf'
        from /var/lib/gems/2.3.0/gems/terraforming-0.18.0/lib/terraforming/resource/elasti_cache_cluster.rb:7:in `tf'
        from /var/lib/gems/2.3.0/gems/terraforming-0.18.0/lib/terraforming/cli.rb:263:in `tf'
        from /var/lib/gems/2.3.0/gems/terraforming-0.18.0/lib/terraforming/cli.rb:250:in `execute'
        from /var/lib/gems/2.3.0/gems/terraforming-0.18.0/lib/terraforming/cli.rb:55:in `ecc'
        from /var/lib/gems/2.3.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
        from /var/lib/gems/2.3.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
        from /var/lib/gems/2.3.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
        from /var/lib/gems/2.3.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
        from /var/lib/gems/2.3.0/gems/terraforming-0.18.0/bin/terraforming:5:in `<top (required)>'
        from /usr/local/bin/terraforming:23:in `load'
        from /usr/local/bin/terraforming:23:in `<main>'

I believe this issue is caused by running terraforming ecc while an ElastiCache cluster is being created. I was able to run terraforming ecc before creating a new ElastiCache instance and then the command produced the above error until the cluster was finished creating.