micronaut-projects / micronaut-aws

Projects specific to integrating Micronaut and Amazon Web Services (AWS)
Apache License 2.0
87 stars 80 forks source link

Support the use of Route53 Service Names instead of only Service Ids. #436

Open bangroot opened 5 years ago

bangroot commented 5 years ago

When using AWS Cloud Map (Route 53 Service Discovery), the Route53AutoNamingClient uses the service id (e.g. srv-xxxxxx) exclusively.

This makes it troublesome for moving between environments for things like @Client usage. I'd like to propose that we add the ability for the Route52AutoNamingClient to also lookup based on Service Name. First impressions are that this could be as simple as maintaining a map in the client that is populated during convertServiceIds and read from during getInstances. I'm happy to pull together a PR.

Steps to Reproduce

  1. Create a service following the guide: https://docs.micronaut.io/latest/guide/index.html#serviceDiscoveryRoute53
  2. Attempt to use @Client("yourservicename")

Expected Behaviour

You should get a valid, load-balanced Client created.

Actual Behaviour

Exception from Route53AutoNamingClient

jameskleeh commented 5 years ago

This seems reasonable to me