title: How can I get the NAT gateway public IP using the AWS CLI?
body: <p>Given a VPC id; I'm using AWS CLI and jq to derive the NAT Gateway address for the given VPC id. Here is what I have so far:</p>
  
  <pre><code>aws ec2 describe-nat-gateways --region='${aws_region}' | jq -r --arg efs_name ${vpcid} '.[] | .[] | select(.VpcId==$vpcid) | {nats: .NatGatewayAddresses}'
  </code></pre>
  
  <p>And the output is:</p>
  
  <pre><code>{
    "nats": [
              {
               "PublicIp": "52.34.207.107",
               "NetworkInterfaceId": "eni-0bc0d320",
               "AllocationId": "eipalloc-fa7739c0",
               "PrivateIp": "172.20.130.224"
              }
            ]
  }
  </code></pre>
  
  <p>Is there a way to get the <code>PublicIp</code> directly using the AWS CLI filters for the nat-gateways resource?</p>