You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having an issue using the Aws::AssumeRoleCredentials call. It is throwing an exception requiring :region to be set. Setting :region does not fix the issues.
ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]
[1] pry(main)> require 'aws-sdk'
�[0G[2] pry(main)> Aws::VERSION
[3] pry(main)> assumed_credentials = Aws::AssumeRoleCredentials.new(
[3] pry(main)* role_arn: 'arn:aws:iam::111111111111:role/role_name',
[3] pry(main)* role_session_name: 'example_session'
[3] pry(main)* )
[4] pry(main)> puts
[5] pry(main)> puts
[6] pry(main)> puts 'Trying to set :region'
[7] pry(main)> assumed_credentials = Aws::AssumeRoleCredentials.new(
[7] pry(main)* region: 'us-east-1',
[7] pry(main)* role_arn: 'arn:aws:iam::111111111111:role/role_name',
[7] pry(main)* role_session_name: 'example_session'
[7] pry(main)* )
[8] pry(main)> puts
[9] pry(main)> puts
[10] pry(main)> puts 'Work around'
[11] pry(main)> Aws.config[:region] = 'us-east-1'
[12] pry(main)> assumed_credentials = Aws::AssumeRoleCredentials.new(
[12] pry(main)* role_arn: 'arn:aws:iam::111111111111:role/role_name',
[12] pry(main)* role_session_name: 'example_session'
[12] pry(main)* )
[13] pry(main)> Aws.config.delete(:region)
[14] pry(main)> puts
[15] pry(main)> puts
[16] pry(main)> puts 'Workaound w/ region set'
[17] pry(main)> Aws.config[:region] = 'us-east-1'
[18] pry(main)> assumed_credentials = Aws::AssumeRoleCredentials.new(
[18] pry(main)* region: 'us-east-1',
[18] pry(main)* role_arn: 'arn:aws:iam::111111111111:role/role_name',
[18] pry(main)* role_session_name: 'example_session'
[18] pry(main)* )
[19] pry(main)> Aws.config.delete(:region)
[20] pry(main)> exit
=> true
=> "2.1.29"
Aws::Errors::MissingRegionError: missing region; use :region option or export region name to ENV['AWS_REGION']
from /home/mtrimmer/.rvm/gems/ruby-2.1.5@wormhole/gems/aws-sdk-core-2.1.29/lib/aws-sdk-core/plugins/regional_endpoint.rb:32:in `after_initialize'
=> nil
=> nil
Trying to set :region
=> nil
Aws::Errors::MissingRegionError: missing region; use :region option or export region name to ENV['AWS_REGION']
from /home/mtrimmer/.rvm/gems/ruby-2.1.5@wormhole/gems/aws-sdk-core-2.1.29/lib/aws-sdk-core/plugins/regional_endpoint.rb:32:in `after_initialize'
=> nil
=> nil
Work around
=> nil
=> "us-east-1"
=> #<Aws::AssumeRoleCredentials:0x00000001526380
@client=#<Aws::STS::Client>,
@credentials=#<Aws::Credentials access_key_id="********************">,
@expiration=2015-10-13 19:53:11 UTC,
@mutex=#<Mutex:0x00000000f000f0>,
@options=
{:role_arn=>"arn:aws:iam::111111111111:role/role_name",
:role_session_name=>"example_session"}>
=> "us-east-1"
=> nil
=> nil
Workaound w/ region set
=> nil
=> "us-east-1"
ArgumentError: unexpected value at params[:region]
from /home/mtrimmer/.rvm/gems/ruby-2.1.5@wormhole/gems/aws-sdk-core-2.1.29/lib/aws-sdk-core/param_validator.rb:26:in `validate!'
=> "us-east-1"
The text was updated successfully, but these errors were encountered:
The stack trace isn't very helpful unless you look pretty deep. When you construct an instance of Aws::AssumeRoleCredentials, an Aws::STS::Client is constructed when one is not given. This client requires a region. The client class will attempt to load the region from ENV['AWS_REGION'] but it seems like a pass-through like you attempted would be more helpful.
I've fixed the documentation so that the :client option will appear in the api docs. I'll see about making the region option (and others) pass through to the client constructor call.
I am having an issue using the Aws::AssumeRoleCredentials call. It is throwing an exception requiring :region to be set. Setting :region does not fix the issues.
The text was updated successfully, but these errors were encountered: