Commit d0dd3fc8 authored by k1LoW's avatar k1LoW

Support `--profile` option

parent d67c1c4b
......@@ -3,6 +3,7 @@ module Terraforming
class_option :merge, type: :string, desc: "tfstate file to merge"
class_option :overwrite, type: :boolean, desc: "Overwrite existng tfstate"
class_option :tfstate, type: :boolean, desc: "Generate tfstate"
class_option :profile, type: :string, desc: "AWS credentials profile"
desc "asg", "AutoScaling Group"
def asg
......@@ -142,6 +143,7 @@ module Terraforming
private
def execute(klass, options)
Aws.config[:credentials] = Aws::SharedCredentials.new(profile_name: options[:profile])
result = options[:tfstate] ? tfstate(klass, options[:merge]) : tf(klass)
if options[:tfstate] && options[:merge] && options[:overwrite]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment