Open StL-Jim opened 4 years ago
Also, I installed using gem install terraforming, here's the list of installed gems gem list
LOCAL GEMS
aws-eventstream (1.0.3) aws-partitions (1.259.0) aws-sdk-autoscaling (1.30.0) aws-sdk-cloudwatch (1.31.0) aws-sdk-core (3.86.0) aws-sdk-dynamodb (1.41.0) aws-sdk-ec2 (1.129.0) aws-sdk-efs (1.23.0) aws-sdk-elasticache (1.29.0) aws-sdk-elasticloadbalancing (1.19.0) aws-sdk-elasticloadbalancingv2 (1.39.0) aws-sdk-iam (1.32.0) aws-sdk-kms (1.27.0) aws-sdk-rds (1.74.0) aws-sdk-redshift (1.35.0) aws-sdk-route53 (1.30.0) aws-sdk-s3 (1.60.1) aws-sdk-sns (1.21.0) aws-sdk-sqs (1.23.1) aws-sigv4 (1.1.0) bigdecimal (1.2.8) did_you_mean (1.0.0) io-console (0.4.5) jmespath (1.4.0) json (1.8.3) minitest (5.8.4) multi_json (1.12.2) net-telnet (0.1.1) power_assert (0.2.7) psych (2.0.17) rake (10.5.0) rdoc (4.2.1) terraforming (0.18.0) test-unit (3.1.7) thor (1.0.1)
Running into something similar here. Did you ever find a solution?
Traceback (most recent call last):
9: from /usr/local/bin/terraforming:23:in `<main>'
8: from /usr/local/bin/terraforming:23:in `load'
7: from /Library/Ruby/Gems/2.6.0/gems/terraforming-0.18.0/bin/terraforming:5:in `<top (required)>'
6: from /Library/Ruby/Gems/2.6.0/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
5: from /Library/Ruby/Gems/2.6.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
4: from /Library/Ruby/Gems/2.6.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
3: from /Library/Ruby/Gems/2.6.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
2: from /Library/Ruby/Gems/2.6.0/gems/terraforming-0.18.0/lib/terraforming/cli.rb:120:in `iamu'
1: from /Library/Ruby/Gems/2.6.0/gems/terraforming-0.18.0/lib/terraforming/cli.rb:250:in `execute'
/Library/Ruby/Gems/2.6.0/gems/terraforming-0.18.0/lib/terraforming/cli.rb:269:in `tfstate': undefined method `[]' for nil:NilClass (NoMethodError)
Same error here too
Traceback (most recent call last):
9: from /usr/local/bin/terraforming:23:in `<main>'
8: from /usr/local/bin/terraforming:23:in `load'
7: from /var/lib/gems/2.5.0/gems/terraforming-0.18.0/bin/terraforming:5:in `<top (required)>'
6: from /usr/lib/ruby/vendor_ruby/thor/base.rb:444:in `start'
5: from /usr/lib/ruby/vendor_ruby/thor.rb:369:in `dispatch'
4: from /usr/lib/ruby/vendor_ruby/thor/invocation.rb:126:in `invoke_command'
3: from /usr/lib/ruby/vendor_ruby/thor/command.rb:27:in `run'
2: from /var/lib/gems/2.5.0/gems/terraforming-0.18.0/lib/terraforming/cli.rb:215:in `vpc'
1: from /var/lib/gems/2.5.0/gems/terraforming-0.18.0/lib/terraforming/cli.rb:250:in `execute'
/var/lib/gems/2.5.0/gems/terraforming-0.18.0/lib/terraforming/cli.rb:269:in `tfstate': undefined method `[]' for nil:NilClass (NoMethodError)
I am getting parse error in Multi-json thrign to merge anything.
vagrant@ubuntu1804:~/SpecialProjects/Output$ terraforming alb --tfstate --merge=.terraform.tfstate --overwrite
Traceback (most recent call last):
11: from /usr/local/bin/terraforming:23:in <main>' 10: from /usr/local/bin/terraforming:23:in
load'
9: from /var/lib/gems/2.5.0/gems/terraforming-0.18.0/bin/terraforming:5:in <top (required)>' 8: from /var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/base.rb:485:in
start'
7: from /var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor.rb:392:in dispatch' 6: from /var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in
invoke_command'
5: from /var/lib/gems/2.5.0/gems/thor-1.0.1/lib/thor/command.rb:27:in run' 4: from /var/lib/gems/2.5.0/gems/terraforming-0.18.0/lib/terraforming/cli.rb:15:in
alb'
3: from /var/lib/gems/2.5.0/gems/terraforming-0.18.0/lib/terraforming/cli.rb:250:in execute' 2: from /var/lib/gems/2.5.0/gems/terraforming-0.18.0/lib/terraforming/cli.rb:267:in
tfstate'
1: from /var/lib/gems/2.5.0/gems/multi_json-1.12.2/lib/multi_json.rb:122:in load' /var/lib/gems/2.5.0/gems/multi_json-1.12.2/lib/multi_json/adapter.rb:20:in
load': JSON::ParserError (MultiJson::ParseError)
If there's no property "modules"
in terraform.tfstate
file, the following codes would cause NoMethodError
problem.
tfstate["modules"][0]["resources"] = tfstate["modules"][0]["resources"].merge(klass.tfstate)
UPDATE I found another tool to merge Terraform state files into one.
Here's the error I get when I try to merge into an existing terraform.tfstate terraforming cwa --tfstate --merge=terraform.tfstate --profile xxxxxxx /var/lib/gems/2.3.0/gems/terraforming-0.18.0/lib/terraforming/cli.rb:269:in'
tfstate': undefined method
[]' for nil:NilClass (NoMethodError) from /var/lib/gems/2.3.0/gems/terraforming-0.18.0/lib/terraforming/cli.rb:250:inexecute' from /var/lib/gems/2.3.0/gems/terraforming-0.18.0/lib/terraforming/cli.rb:25:in
cwa' from /var/lib/gems/2.3.0/gems/thor-1.0.1/lib/thor/command.rb:27:inrun' from /var/lib/gems/2.3.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in
invoke_command' from /var/lib/gems/2.3.0/gems/thor-1.0.1/lib/thor.rb:392:indispatch' from /var/lib/gems/2.3.0/gems/thor-1.0.1/lib/thor/base.rb:485: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 `