I’ve never done it with Elastic Beanstalk, but I have gotten AWS Service Discovery to work with ECS Fargate and libcluster using this:
topologies = [
ecs_app: [
strategy: Cluster.Strategy.DNSPoll,
config: [
polling_interval: 1000,
query: "phx-fargate.phx-fargate.local",
node_basename: "phx_fargate"
]
]
]
Not sure if the DNS strategy might work better for you there. See this thread for more details: Distributed Elixir in Amazon ECS for more discussion. With AWS offering Service Discovery out of the box, you no longer need to mess around with A records and DNS entries. This is my config in the Service in ECS.
Hope this was helpful.