DNS Interface service discovery in AWS Lambda

Hello,

Lambda has no Consul Client or DNS forwarder running in it, how would I talk to e.g. consul.service.consul within Lambda? I did manage to find something to use Route 53 DNS Forwarder or something like that, but can not find article now.

Would appreciate to get reference to articles or to explanation on how to achieve consul.service.consul resolution within Lambda.

Thank you.

I don’t have a good answer at the moment about how to go about incorporating AWS Lambda with Consul’s DNS but I agree it would be good to figure that out and add it to our DNS forwarding guide.

I have opened a enhancement request for this: https://github.com/hashicorp/consul/issues/6111

1 Like

@mkeeler could you please take a look here and see if it has any points that can be used: https://www.itdiversified.com/integrating-hashicorp-consul-with-amazon-route-53-resolver/

I will do my own reading on Amazon Route 53 Resolver and try tomorrow see how it works with Lambda, if it works at all.

I went through AWS Route 53 Resolver and it does not seem to be a solution, first I could not set “.consul” as domain to forward, and second it allows only to put IP address to forward to, that is not scalable in case of ASG.

My idea for now is to use Internal Load Balancer + Private Hosted Name to talk to Vault/Consul from Lambda, though not sure what are complications or nuances of this approach yet.

Surely you just need a DHCP Options Set on the subnet running the aws lambda set to the consul server IPs. reconfigure consul to listen to dns on 53 and then look up your consul based dns domains as normal.

(PS I did this 3 years ago, so I’d be surprised if it didnt work any more)