2

I have a few services running in aws ecs which need access to the internet. These services will be running single instances. Each of the internet facing services will have a one-to-one mapping between service name and ec2 private ip address. Other services within the VPC need to discover the internet facing services with service discovery. All services are run in aws ecs using host mode. Host mode does not allow me to create A DNS records. I can only create SRV records.

All services are written in .net core 3.0.

Is there a way to locate the ip address from a SRV record in a similar manner to simple DNS lookup? for example Host=my-service.myprivatenamespace

Things I have tried:

  1. I can use the aws .net sdk to look up the ip address given a few queries. This was becoming cumbersome. I was hoping for a simple A record DNS lookup approach.
  2. I have read the documentation for Route 52, ECS and Cloud Map but was unable to find a solution.

Some cost constraints:

  1. Fargate allows A records but costs too much - I will not use Fargate
  2. ECS awsvpc network mode allows A DNS records but requires the added cost of a Nat Gateway to access the internet - I will not use awsvpc.

It seems that AWS is considering A records for host mode. Maybe I just need to wait a bit longer...

https://github.com/aws/containers-roadmap/issues/279

MAC720
  • 21
  • 4
  • Have you tried looking at 3rd party libraries to resolve SRV records?. [This](http://dnsclient.michaco.net/) .net core library does seem to resolve SRV records. Once you get the result, which should be pretty standard for you make next API call. Check this [SO](https://stackoverflow.com/a/56944833/5030709) answer which has some explanation of SRV lookups in ECS. – Imran Dec 13 '19 at 17:18

0 Answers0