I have a container running on ECS as a Fargate service. It has a service discovery with a public DNS namespace "frontend.example.com".
I can access the container when I call the public IP, but not using the public DNS namespace..
I also tried pointing a Route53 DNS record to this public DNS namespace "frontend.example.com", but that did now work as well.
Is this even possible? Because I read on some forums that you can access a fargate service only with an ALB connected to the service namespace or updating the public IP address on the Route53 each time the fargate container is updated.
So again in short, can I use the public DNS namespace (created by CloudMap) attached to a fargate service (with service discovery) to access it from the internet?
CloudMap is for communications between your services, inside your private VPC. You really should use an ALB to expose your ECS service publicly on the Internet.