I'm searching for a way to add a domain name to an ECS service (containers) without a load balancer.
The particular type of service I want to do this for is itself a load balancer with capabilities outside of AWS's offering. We need this to be redundant across availability zones with similar setups in multiple isolated VPCs. I'm really loathed to spend $2000 per year to put in enough loadbalancers to fulfil this simple requirement.
To be clear I'm looking for a solution which resolves an FQDN to an external IP address attached to the container so A or AAAA name (possibly CNAME if its weighted and points to an A or AAAA). It doesn't matter to me which network mode this works for. The container can be placed in any of host, bridge, awsvpc if the solution works!
So far I've found this frustratingly limited:
- Service Discovery will only add SRV records for
host and bridge type network containers
- Service Discovery will create A and AAAA records for
awsvpc network type containers, but awsvpc tasks can't be placed on ECS EC2 instances and still have a public IP address.
- Running the same tasks in fargate would cost as much or more than the load balancers.
- Route53 has no good mechanism for adding A and AAAA name records to EC2 instances in an autoscaling group so even if I put an instance of this task on every node I still won't be able to reference it by domain name.
How to add a domain name to an ECS container without a load balancer?