How can I use a static or Elastic IP address for an Amazon ECS task on Fargate ?


My ecs task running with application load balancing and want to access access to global via NAT Gateway. Could you tell me how ?

asked 8 months ago402 views
1 Answer
Accepted Answer

The subnet where the ECS task is deployed should be a private subnet.
Also, make sure that there is a route to the NAT Gateway in the route table of the deployed subnet.
The configuration is similar to the following document.

profile picture
answered 8 months ago
profile pictureAWS
reviewed 8 months ago
  • Thanks for you answers, actually I also try a private subnet sir, It able to access to global via nat but the static ip still not get on ecs task

  • As described in this document, it is not possible to set an Elastic IP directly to a task.
    In other words, if the destination has IP address restrictions or other restrictions, it is necessary to register to allow the NAT Gateway's IP address.

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