darthfather
darthfather

Reputation: 377

Connect to database running in AWS Fargate Task

I created a task definition that runs a Neo4j database, opened the ports 7474 and 7687 for the database http and bolt connectors, and launched the task definition in a ECS service of type Fargate in a private subnetwork.

How can I get the IP address of the container running the database without an ALB?

Thanks

Upvotes: 1

Views: 1070

Answers (1)

Roy Kachouh
Roy Kachouh

Reputation: 1903

There are a couple of ways to obtain the ip address of your running container. Through the console the private subnet should be accessible as a link, and when you click on the subnet you should be able to see the private ip address.

You can also make use of the command line to describe your tasks. The describe output should contain the ip address of your running conatiner:

https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html#API_DescribeTasks_RequestSyntax

Finally, in Fargate there is also a metadata endpoint that is exposed in each running container, if need be, you can programmatically access that endpoint to obtain the ip address in your private subnet:

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-metadata-endpoint.html#task-metadata-response

Upvotes: 1

Related Questions