amazon web services - AWS Cli list IPAddess and name tag -


how can list ipaddress , name tag using aws cli aws ec2 describe-instances --query "reservations[*].instances[*].privateipaddress[*]" --output table

gives me list of ipaddess need ip address , name tag.

please help.

you can following

aws ec2 describe-instances \ --query "reservations[*].instances[*].{privateip:privateipaddress, tags:tags[*]}"  

you can add table output if needed visibility not if have multiple tags

aws ec2 describe-instances \ --query "reservations[*].instances[*].{privateip:privateipaddress, tags:tags[*]}" \ --output table 

the output

---------------------------- |     describeinstances    | +--------------------------+ |         privateip        | +--------------------------+ |  172.xx.x.xx             | +--------------------------+ ||          tags          || |+--------------+---------+| ||      key     |  value  || |+--------------+---------+| ||  name        |  xxxxx  || ||  autobuild   |  xxxxx  || ||  environment |  xxxxx  || |+--------------+---------+| 

Comments