-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Support multiple configurations #403
Comments
Could you describe a case when this feature is needed? |
Thank you, for example, in the same rails project, you need to connect two Amazon's DynamoDB, different access_key, secret_key, region |
I see. Will add this feature request for the next minor release in 3-4 months. So actually there are two options:
Let's consider both options. I am still not sure whether we need only one of them or both. Option #1Let's consider an example: class User
include Dynamoid::Document
configure do |config|
config.access_key = 'REPLACE_WITH_ACCESS_KEY_ID'
config.secret_key = 'REPLACE_WITH_SECRET_ACCESS_KEY'
config.region = 'us-west-2'
end
end Option #2Consider another example: class User
include Dynamoid::Document
end
Dynamoid.configure(access_key: '', secret_key: '', region: '') do
User.count
end |
thank you very much! |
I agree, option 1 seems preferable. |
It would be very helpful, in my case I'm trying to use a different namespace for one model and it's not possible. |
I'd love to see a per-model configuration as well. This helps when needing to deal with data that's sourced from multiple regions (and the source applications can't be housed in a single region). |
Will prioritize this task 👍 . |
@andrykonchin any updates on this? |
No, there is no update yet. |
@andrykonchin any updates? |
No, it isn't implemented yet. I am going to include it into the next release. |
Being able to specify or config the Aws::DynamoDB::Client in the model seems like an ok idea to me. Another idea is that DynamoDB tables can be accessed cross-account. Hopefully specifying table ARNs in place of table names works in Dynamoid. Avoiding long lived tokens is recommended these days. Being able to use a model with some freshly generated temporary tokens could be useful e.g. running a backup job or processing some data. |
Support two or more aws configuration or specify configuration for model
The text was updated successfully, but these errors were encountered: