spring-attic/grails-data-mapping

simpledb: how to set region endpoint ?

Closed this issue · 4 comments

k2s commented

Is there some way to configure SimpleDb plugin to connect to DB in other then default region ?

I am looking for some configuration parameter like:

endpoint = 'sdb.eu-west-1.amazonaws.com'

  • OR -

region = 'eu-west-1'

Hi, could you please help me a bit and research where in the AWS SDK API these things are set/configured? I will then try to add appropriate calls to the plugin initialization.

k2s commented

Hi, I am using another plugin http://grails.org/plugin/aws-sdk to communicate with S3 and I like how configuration works there. It is documented here http://benorama.github.io/grails-aws-sdk/guide/single.html#configuration. There are much more options which should be configurable not only region.

Maybe, would it be possible for your plugin to read grails.plugin.awssdk config or to utilize awssdk plugin in other way ?

In fact central functionality provided by awssdk plugin is in https://github.com/benorama/grails-aws-sdk/blob/master/grails-app/services/grails/plugin/awssdk/AmazonWebService.groovy to create communication to services with getServiceClient(String service, String regionName = '', Boolean async = false) method.

Just pushed f2dc0c8 - you can set 'endpoint' property in the same fashion you set secretKey for simpledb plugin. If not specified plugin will behave as it did before this change. I did not publish updated version plugin, please for now use local version.