lib/terraforming/cli.rb in terraforming-0.10.0 vs lib/terraforming/cli.rb in terraforming-0.11.0
- old
+ new
@@ -12,10 +12,15 @@
desc "asg", "AutoScaling Group"
def asg
execute(Terraforming::Resource::AutoScalingGroup, options)
end
+ desc "cwa", "CloudWatch Alarm"
+ def cwa
+ execute(Terraforming::Resource::CloudWatchAlarm, options)
+ end
+
desc "dbpg", "Database Parameter Group"
def dbpg
execute(Terraforming::Resource::DBParameterGroup, options)
end
@@ -214,13 +219,13 @@
def tf(klass)
klass.tf
end
def tfstate(klass, tfstate_path)
- tfstate = tfstate_path ? JSON.parse(open(tfstate_path).read) : tfstate_skeleton
+ tfstate = tfstate_path ? MultiJson.load(open(tfstate_path).read) : tfstate_skeleton
tfstate["serial"] = tfstate["serial"] + 1
tfstate["modules"][0]["resources"] = tfstate["modules"][0]["resources"].merge(klass.tfstate)
- JSON.pretty_generate(tfstate)
+ MultiJson.encode(tfstate, pretty: true)
end
def tfstate_skeleton
{
"version" => 1,