Assigning a static IP to an ECS container hosted on an EC2 instance

0

My use case is that I want to be able to terminate and start my ECS container and have it be available at the same static IP that was available previously. The container requires inbound and outbound internet access at port 8080. I believe I need to use a network load balancer to route traffic from an elastic IP, but I am unsure how to associate the network load balancer with any EC2 instance that is launched by the Auto Scaling Group that is attached to my ECS service.

1 回答
1

Hi, in the console when you are creating the ECS service you have an option to enable the load balancing, creating a new or using existing resources (load balancer and target group). The ECS will register you tasks in the target group automatically.

profile picture
已回答 10 个月前
profile picture
专家
已审核 10 个月前
  • Agree. You do not need a static IP address when using a ELB. You rely on ECS registering to a target group. You should evaluate if an ALB is more appropriate than an NLB

  • You can find the steps to configure the ECS Service with a loadbalancer integration on this documentation.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则