Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aws::S3::Encryption::Client cannot be instantiated with explicitly defined region #803

Closed
dakaneye opened this issue May 1, 2015 · 3 comments
Labels
duplicate This issue is a duplicate.

Comments

@dakaneye
Copy link

dakaneye commented May 1, 2015

1.9.3-p125 :002 > opts = {:access_key_id => "XXXX", :secret_access_key=>"XXXX", :region=>"us-east-1", :encryption_key => "XXXX"}
 => {:access_key_id=>"XXXX", :secret_access_key=>"XXXX", :region=>"us-east-1", :encryption_key=>"XXXX"} 
1.9.3-p125 :003 > client = Aws::S3::Encryption::Client.new(opts)
Aws::Errors::MissingRegionError: missing region; use :region option or export region name to ENV['AWS_REGION']
    from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/aws-sdk-core-2.0.41/lib/aws-sdk-core/plugins/regional_endpoint.rb:30:in `after_initialize'
    from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/aws-sdk-core-2.0.41/lib/seahorse/client/base.rb:86:in `block in after_initialize'
    from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/aws-sdk-core-2.0.41/lib/seahorse/client/base.rb:85:in `each'
    from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/aws-sdk-core-2.0.41/lib/seahorse/client/base.rb:85:in `after_initialize'
    from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/aws-sdk-core-2.0.41/lib/seahorse/client/base.rb:23:in `initialize'
    from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/aws-sdk-core-2.0.41/lib/aws-sdk-core/client_stubs.rb:19:in `initialize'
    from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/aws-sdk-core-2.0.41/lib/seahorse/client/base.rb:107:in `new'
    from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/aws-sdk-resources-2.0.41/lib/aws-sdk-resources/services/s3/encryption/client.rb:183:in `initialize'
    from (irb):3:in `new'
    from (irb):3
    from /usr/local/rvm/rubies/ruby-1.9.3-p125/bin/irb:12:in `<main>'

Additional info:
System: Centos 6.6
Ruby Version: 1.9.3-p125

I exported the region as an Environment Variable and that seems to work, but explicit definition in the instantiation of the client seems to be a bug.

@trevorrowe
Copy link
Member

Closed as a duplicate of #800

The workaround it to construct a vanilla Aws::S3::Client and pass that in via :client. I corrected the documentation on this, and then expanded the initialize method to accept vanilla client options as well, such as :region.

@trevorrowe
Copy link
Member

Sorry for the confusion.

@dakaneye
Copy link
Author

dakaneye commented May 1, 2015

Thanks Trevor. I appreciate the clarification!

@srchase srchase added the duplicate This issue is a duplicate. label Dec 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue is a duplicate.
Projects
None yet
Development

No branches or pull requests

3 participants