Question: I've built an AWS CodePipeline to build and deploy containers into Fargate managed EC2 instances. Ref [AWS CodePipeline](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-cd-pipeline.html)

One of the services is a web server and I'm attempting to access it from the public which is possible via a public assigned IP address; however, that's not very useful as each deployed container receives a fresh IP address.

I understand it's possible to setup Elastic IP addresses or point a domain to the container service but I'd think there is an easier way.

EC2 instances can be launched with the option of providing a Public DNS...

Is it possible to launch container services with a static public DNS record? If so, how?

Answer: 
You can use [ECS Service Discovery](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html) for registering your containers in a private DNS namespace - unfortunately this is not possible with public DNS.

But, what you can do, is to have a script 

* fetch your containers' public IP after redeployment and
* upsert your public Route 53 record set with that IP.

[In this article](https://medium.com/@andreas.pasch/automatic-public-dns-for-fargate-managed-containers-in-amazon-ecs-f0ca0a0334b5), we describe how to do exactly that by using a generic lambda function.
When I set up an ECS Fargate service for the first time, the setup wizard seems to have automatically (?) created a load balancer for me. I was able to access the web app that I created via the URL at Amazon ECS -> Clusters -> {my cluster} -> {my service} -> Target Group Name (under Load Balancing in the Details tab) -> {my target group} -> Load Balancer -> DNS Name