From e71203b641d7364c4a9145b71ad87f7b01885feb Mon Sep 17 00:00:00 2001 From: texpert Date: Sat, 25 Jan 2020 00:38:22 +0200 Subject: [PATCH] AWS region fetching from profile - workaround. It is an AWS bug, as stated in this closed issue - https://github.com/dtan4/terraforming/issues/235 Indeed, it is an old one - https://github.com/aws/aws-sdk-ruby/issues/1256, let's temporarily fix it here with this PR. --- lib/terraforming/cli.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/terraforming/cli.rb b/lib/terraforming/cli.rb index ad0ad858..f38ef31d 100644 --- a/lib/terraforming/cli.rb +++ b/lib/terraforming/cli.rb @@ -234,7 +234,11 @@ def snss 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.config[:region] = if options[:region] + options[:region] + elsif (region = Aws.shared_config.region(options)) + region + end if options[:assume] args = { role_arn: options[:assume], role_session_name: "terraforming-session-#{Time.now.to_i}" }