i am digging on aws cli and from past 5 hours i struggling with 2 cli commands
i should get InstanceId, Name(this is a tag value) and specific tag value by providing its key ( including not tags given i.e NULL)
I should get InstanceId, Name and specific tag value by providing its key ( excluding NULL tags)
i got 50% of the answer for the 1 Question & 2 Question 0%
My cli command:
aws ec2 describe-instances --query 'jsondata[ ].Instances[ ].[InstanceId, [Tags[?keys='Name'].Value] [0][0]' --output table`
Ex: {
"Jsondata" : [
{ "Instances" : "i-xxxxxx",
"Tags":[
{ "valve":" testserver",
"key": "server"
},
{ "valve":" elb",
"key": "Name"
}
]
},
{ "Instances" : "i-yyyyyy",
"Tags":[
{ "valve": " ",
"key": " "
},
{ "valve":" elb2",
"key": "Name"
}
]
}
]`
Thanks in advance. Please help me i need to sleep