Reputation: 323
We have an Application Load Balancer in AWS and we are trying to load balance the requests to internal DNS names instead of IPs.
For example:
We are trying to load balance to internal-abc.host.com
and internal-efg.host.com
instead of 10.0.10.1 and 10.0.10.2
However, when configuring the targets of the ALB we seem to only have the option to specify one or more IP addresses instead of a DNS name.
The reason we want to use a DNS instead of IPs is that the services we are requesting from the ELB are created from a service in a peered VPC that we do not have control over and the private IPs often change.
We have considered spinning up Nginx across our different Availability Zones and using Nginx to re-route the requests onto the DNS... however it feels like we are missing a more direct approach.
We also read this AWS post that suggests using S3 may be an option, however we feel that S3 isn't really designed for this purpose.
We also looked into setting up a reverse DNS on Route53 e.g. using in-addr.arpa
as explained here however this seems to only be for public IPs as explained here and we want to use the private IP to only route traffic using VPC peering.
Thanks.
Upvotes: 8
Views: 11486
Reputation: 179412
Application Load Balancer does not support any kind of dynamic targets -- they are always specified by instance-id or IP address.
To accomplish what you want, running something reverse proxy-capable like Nginx or HAProxy on the same VPC as the balancer is the only real option. You should find that very small instances are sufficient for such a task -- I run HAProxy on t2.nano and t2.micro and have systems that handle millions of requests per day while barely using any CPU at all. I assume Nginx would perform similarly when its only task is proxying requests.
Upvotes: 5