I'm currently having an issue with ECS Service Discovery and Route53 Auto Naming.
I have added the Service Registry to the service and all the Hosted Zones records are being populated automatically. But I cannot seem to work out how to resolve the DNS SRV records with NGINX + ngx_upstream_resolveMK.
# DNS RESOLVER
resolver ns-x.awsdns-xx.com valid=10s;
# UPSTREAMS
upstream kibana {
resolveMK servicediscovery.ecs service=kibana;
}
# HOST - kibana.example.com
server {
server_name kibana.example.com;
listen 80;
location / {
proxy_pass https://kibana/;
rewrite ^/(.*)$ /$1 break;
}
}
ERROR: nginx: [emerg] host not found in upstream "servicediscovery.ecs" in /usr/local/nginx/sites-enabled/kibana.conf:3
So it appears that there is a missing A record needed to resolve "servicediscovery.ecs" to the Route 53 Private Zone.
Do I need to manually add this? or is there a way to dynamically add this A record?
I think this is the cause of the problem, but I'm still learning and might be way off.
UPDATE:
I read you can also use xxx.xxx.xxx.2 to access the DNS via AWS VPC I have tested using a new resolver without much luck.
# DNS RESOLVER
resolver xxx.xxx.0.2 valid=10s;