vendredi 24 juillet 2015

Combine 2 sections of aws ec2 describe-instance output

I am trying to combine the following 2 commands into 1

aws ec2 describe-instances --query Reservations[].Instances[].State[].{InstanceState:Name} --output table

aws ec2 describe-instances --query Reservations[].Instances[].Tags[].{InstanceName:Value} --output table

My last ditch plan is to call both separately but I am sure there is a way to do this in 1 line. The closet I got was 1 table with the incorrect instance name using the command below.

aws ec2 describe-instances --query Reservations[].Instances[].State[].{InstanceState:Name,InstanceName:Tags.Value} --output table

Sample output

    Describe Instances
InstanceName | InstanceState
Name A       | running
Name B       | stopped

Does anyone know what I am missing?




Aucun commentaire:

Enregistrer un commentaire