rabbitmq / rabbitmq-peer-discovery-aws

AWS-based peer discovery backend for RabbitMQ 3.7.0+
Other
24 stars 11 forks source link

Make it possible to use region-specific AWS API endpoint #23

Closed michaelklishin closed 6 years ago

michaelklishin commented 6 years ago

See this rabbitmq-users thread.

The plugin currently uses AWS API endpoint(s) specific to the US region. We should make this configurable and, provided that we already ask for the region to be configured, pick the default according to the AWS docs.

gmr commented 6 years ago

Location where this happens: https://github.com/gmr/rabbitmq-aws/blob/master/src/rabbitmq_aws.erl#L220

I don't know if it makes sense to hardcode a table of TLDs and wonder if that value is discoverable. Going to see what boto3 does in this circumstance.

gmr commented 6 years ago

It's ugly: https://github.com/boto/botocore/blob/7d098b9c2f60bcbb6b1ef72e7e2b83531caaac7d/botocore/data/endpoints.json

michaelklishin commented 6 years ago

@gmr so they basically use a table of known values. Since this plugin uses a very limited set of services, would you agree it'd be sufficient to compute the "base host" using a function with preconfigured heads?

gmr commented 6 years ago

Unfortunately, as inelegant as it is. I'd much rather be able to discover this but meh, should be a simple change.

michaelklishin commented 6 years ago

@gmr any tweaks you'd like to see in https://github.com/rabbitmq/rabbitmq-aws/pull/7?