I'm trying to resolve simple issue. How can I specify connection string to AWS ECS fargate-hosted task, which will preserve task restarts? I created a task definition, then started a task. Ok, I see the private IP address. But I have no guarantee that it will be same when I change task definition or restart a task.
I'm starting JanusGraph database as a service that way, so my other EC2 instances need to know how to access it internally, in VPC (I don't need external Elastic IP). How can I do this?
You need to enable ECS Service Discovery, so that your container will be mapped to a DNS name inside your VPC. ECS will manage updates to that DNS name if your task is restarted.