I'm attempting to run logstash in a container against ECS, which will listen for log messages over UDP.
I want my apps to be able to send messages to e.g. logging.mydomain.com without needing to know the underlying IP(s) which may change.
Normally I would CNAME an ELB, but ELB does not support UDP. Do I need to do some kind of service discovery here or is there something simpler I can do?
You can use an Amazon ECS task definition to specify multiple containers. All the containers that you specify are deployed along the same compute capacity. Don't use this feature to add multiple application containers to the same task definition because this prevents copies of each application scaling separately.
Amazon ECS is a highly scalable, high performance container management service that supports Docker containers and allows you to easily run applications on a managed cluster of Amazon EC2 instances.
In the same ECS service, containers can communicate with each other by localhost. In the diffrent ECS service, containers can communicate with each other by service discovery.
I would recommend using Amazon Route 53 DNS round robin to solve this problem.
The pieces are:
There is a reference architecture that described this in more detail, and has sample code for you: https://aws.amazon.com/blogs/compute/service-discovery-for-amazon-ecs-using-dns/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With