From da5e91772677ff187a617eb6d71772c6b6bcfba5 Mon Sep 17 00:00:00 2001 From: Andrew Hill Date: Wed, 27 Nov 2019 11:30:16 +0000 Subject: [PATCH] issue #532: ignore aws config/env if region has already been specified in the object --- lib/vagrant-aws/config.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/vagrant-aws/config.rb b/lib/vagrant-aws/config.rb index ffea15d8..92b2163c 100644 --- a/lib/vagrant-aws/config.rb +++ b/lib/vagrant-aws/config.rb @@ -330,7 +330,10 @@ def finalize! if @access_key_id == UNSET_VALUE or @secret_access_key == UNSET_VALUE @aws_profile = 'default' if @aws_profile == UNSET_VALUE @aws_dir = ENV['HOME'].to_s + '/.aws/' if @aws_dir == UNSET_VALUE - @region, @access_key_id, @secret_access_key, @session_token = Credentials.new.get_aws_info(@aws_profile, @aws_dir) + region_aws, @access_key_id, @secret_access_key, @session_token = Credentials.new.get_aws_info(@aws_profile, @aws_dir) + if @region == UNSET_VALUE + @region = region_aws + end @region = UNSET_VALUE if @region.nil? else @aws_profile = nil