Question about ECS Fargate

0

I am trying to deploy my.net core service in a container on AWS ECS, and I want to imply when this service start it will register in my consul server and execute health check, but I can only get my host ip after it is deployed, I can not pass the right host ip address to consul server so that I can not execute health check, is there any way to get host ip from container?

2 Answers
0
Accepted Answer

Im guessing you get the container ip and not the host it’s running on?

Is this similar to https://groups.google.com/g/nomad-tool/c/S-MS5sbmzJ0?pli=1

If not you will never get the host IP until It’s deployed is it will be deployed in a cluster.

profile picture
EXPERT
answered a year ago
  • Sorry for the late reply, I just find a way to solve this. By using Dns.GetHostEntry(Dns.GetHostName()).AddressList.First(), it can easily get the private IP address of server. At first, I use toString() rather than first().but finally it works. Thank you Again.!!

0

Hello, Do you have all the prerequisites that Consul requires?

https://developer.hashicorp.com/consul/docs/ecs/requirements

AWS
answered a year ago
  • Yes, Finally solved problem, thanks your time

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions