0

I'm using CDK (via the Typescript lib) to setup my network infrastructure on ECS. There are some background workers that often report errors to a Slack channel and I'd like to assign random hostnames based on their names, something like worker-<generated-name>.internal or web-<generated-name>.internal.

These don't have ELB or anything, they're internal services with no exposure to the web. But I still would like to have better names than ip-10-10-10-10.internal on my monitoring tools.

  • I suspect there will be just as many people advocating for this as against it. I don't like it myself, but I also don't like a lot about AWS. This data is useless and isn't consumable or cross-referenceable to other sources. – Greg Askew May 14 '22 at 00:03
  • I'm mainly interested in understanding what type of service is it based on the hostname. It does sound like something useful to me, but I'm open to alternatives, considering my monitoring tool (Appsignal) identifies the hosts by their hostnames. – Pedro Nascimento May 14 '22 at 01:16
  • Also is this a question appropriate to server fault or stack overflow? If this is the wrong place to ask, please close the question. – Pedro Nascimento May 14 '22 at 02:04

1 Answers1

0

You can set the hostname for tasks on ECS: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html (search for hostname)

However it is apparently not available for tasks with awsvpc network mode, which in turn means that it won't work for Fargate tasks. Only on those running on ECS hosts.

MLu
  • 23,798
  • 5
  • 54
  • 81