How do I retrieve the public IP for a fargate task using the CLI? : <p>I have a cluster running with services and am also able to launch fargate tasks from the command line. I can get the taskArn as a response to launching the task and I can wait for the task to be in the running state by using "aws ecs wait". I'm stuck figuring out how to get the the public IP of the task. I can find it via the web page easily enough and can access the machine via it's public IP...</p>

<p>How do I get the public IP of a fargate task using the CLI interface?</p>

<p>I'm using the following commands to launch the task, wait for it to run and retrieve the task description:</p>

<pre><code>$ aws ecs run-task --launch-type FARGATE --cluster xxxx --task-definition xxxx --network-configuration xxxx
$ aws ecs wait &lt;taskArn&gt;
$ aws ecs describe-tasks --cluster xxxx --task &lt;taskArn&gt; | grep -i ipv4
</code></pre>

<p>The last command only gives me the private IP...</p>

<pre><code>"privateIpv4Address": "10.0.1.252",
"name": "privateIPv4Address"
</code></pre>

<p>I've also tried using:</p>

<pre><code>$ ecs-cli ps --cluster xxxx
</code></pre>

<p>But the Ports column is blank.</p>

<pre><code>Name                                       State    Ports  TaskDefinition
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/xxxx  RUNNING         xxxx:1
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/xxxx  RUNNING         xxxx:1
</code></pre>
