tristanmorgan/awskeyring

Error adding account when region is not specified

carldjohnston opened this issue · 1 comments

Error adding an account when a region is not specified.

This error is not shown when either the AWS_REGION or AWS_DEFAULT_REGION environment variables are set, or a region is specified in the default profile in ~/.aws/config

> awskeyring add testing
       access key id: AAAAAAAAAAAAAAAAAAAA
   secret access key: ****************************************
  mfa arn (optional):
Traceback (most recent call last):
	26: from /usr/local/bin/awskeyring:23:in `<main>'
	25: from /usr/local/bin/awskeyring:23:in `load'
	24: from /usr/local/lib/ruby/gems/2.5.0/gems/awskeyring-0.3.0/exe/awskeyring:10:in `<top (required)>'
	23: from /usr/local/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
	22: from /usr/local/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
	21: from /usr/local/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
	20: from /usr/local/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
	19: from /usr/local/lib/ruby/gems/2.5.0/gems/awskeyring-0.3.0/lib/awskeyring_command.rb:139:in `add'
	18: from /usr/local/lib/ruby/gems/2.5.0/gems/awskeyring-0.3.0/lib/awskeyring/awsapi.rb:108:in `verify_cred'
	17: from /usr/local/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.17.1/lib/seahorse/client/base.rb:99:in `new'
	16: from /usr/local/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.17.1/lib/aws-sdk-sts/client.rb:143:in `initialize'
	15: from /usr/local/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.17.1/lib/seahorse/client/base.rb:19:in `initialize'
	14: from /usr/local/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.17.1/lib/seahorse/client/base.rb:62:in `build_config'
	13: from /usr/local/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.17.1/lib/seahorse/client/configuration.rb:150:in `build!'
	12: from /usr/local/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.17.1/lib/seahorse/client/configuration.rb:177:in `apply_defaults'
	11: from /usr/local/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.17.1/lib/seahorse/client/configuration.rb:189:in `resolve'
	10: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/set.rb:338:in `each'
	 9: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/set.rb:338:in `each_key'
	 8: from /usr/local/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.17.1/lib/seahorse/client/configuration.rb:189:in `block in resolve'
	 7: from /usr/local/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.17.1/lib/seahorse/client/configuration.rb:200:in `value_at'
	 6: from /usr/local/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.17.1/lib/seahorse/client/configuration.rb:204:in `resolve_defaults'
	 5: from /usr/local/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.17.1/lib/seahorse/client/configuration.rb:57:in `each'
	 4: from /usr/local/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.17.1/lib/seahorse/client/configuration.rb:57:in `each'
	 3: from /usr/local/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.17.1/lib/seahorse/client/configuration.rb:205:in `block in resolve_defaults'
	 2: from /usr/local/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.17.1/lib/seahorse/client/configuration.rb:70:in `call'
	 1: from /usr/local/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.17.1/lib/aws-sdk-core/plugins/signature_v4.rb:9:in `block in <class:SignatureV4>'
/usr/local/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.17.1/lib/aws-sdk-core/plugins/signature_v4.rb:88:in `build_signer': missing region; use :region option or export region name to ENV['AWS_REGION'] (Aws::Errors::MissingRegionError)

Hi @carldjohnston the fix for this issue will be in the next release.