AWS re:Postを使用することにより、以下に同意したことになります AWS re:Post 利用規約

Ecs conect fargate tasks

1

How can I give a task an internal fixed ip or an internal dns host to connect from another task of another service?

質問済み 2年前469ビュー
3回答
0

You could use a load balancer, though that may be excessive. Have you looked at AWS Cloud Map? It's a service discovery service, and may be able to provide the lookup you need.

profile picture
回答済み 2年前
  • it looks like Cloud Map to register a service requires IP address... but with using Fargate as a capacity provider, as far as I understand, it's always dynamic

0

That is the standard way to do it. Because being something so normal, I imagine that it will be biased in one way, or not?

回答済み 2年前
0

I have the same issue. I'm starting a service using ECS Fargate model, and simply need to access this service from VPC INTERNALLY, it should not be available publicly. Obviously, I'm assuming it should not be additional cost/delay. As far as I understand right now, each time new task is created by ECS based on your task definition, it could have different private IP address. So, you cannot use it in, say, a connection string of your other services. I'm not sure if this is correct, but it looks like I have to implement some kind of service discovery feature, when either service registers it's private ip address somehwere when it starts, or client quires amazon services and figures out service ip address in VPC based on task metadata, like by parsing result of a CLI command: aws ecs describe-tasks --cluster your_cluster_name_here --tasks 6fafaa335_id_of_instantiated_task Will return you something like: { "tasks": [ { "attachments": [ { "id": "ffffffff-171e-43e7-8ef3-10c5a2ec396c", "type": "ElasticNetworkInterface", "status": "ATTACHED", "details": [ { "name": "subnetId", "value": "subnet-fffffffff" }, { "name": "networkInterfaceId", "value": "eni-fffffffffffffffff" }, { "name": "privateDnsName", "value": "ip-163-44-44-241.us-east-2.compute.internal" }, { "name": "privateIPv4Address", "value": "163.44.44.241" } ] } ],

回答済み 2年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ