Get the public IP address of an EC2 instance by tag. This can be used to fetch any property of an instance.

The example fetches the Public IP address of the first instance with the Name tag set to foo.

aws ec2 describe-instances \
  --filters "Name=tag:Name,Values=foo" \
  --query 'Reservations[*].Instances[0].PublicIpAddress' \
  --output text