Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
Extract configure_aws method
Browse files Browse the repository at this point in the history
  • Loading branch information
dtan4 committed Aug 2, 2016
1 parent 0ec6bdc commit 7105c81
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/terraforming/cli.rb
Expand Up @@ -201,10 +201,14 @@ def vgw

private

def execute(klass, options)
def configure_aws(options)
Aws.config[:credentials] = Aws::SharedCredentials.new(profile_name: options[:profile]) if options[:profile]
Aws.config[:region] = options[:region] if options[:region]
Aws.use_bundled_cert! if options[:use_bundled_cert]
end

def execute(klass, options)
configure_aws(options)
result = options[:tfstate] ? tfstate(klass, options[:merge]) : tf(klass)

if options[:tfstate] && options[:merge] && options[:overwrite]
Expand Down

0 comments on commit 7105c81

Please sign in to comment.