I am using the below query:
aws ec2 describe-instances | jq -r '.Reservations[]|.Instances[]|[(.Tags[]?|select(.Key=="Name")|.Value), (.Tags[]?|select(.Key=="Group-Name")|.Value),.InstanceId,.PrivateIpAddress]|@csv'|sort
Which outputs as follows:
"sit-test1-zoo-1","i-01205c55a999bebbf","10.153.XX.XXX"
"sit-test2-zoo-2","i-064167c876934448","10.153.XX.XXX"
But I wanted to slide in the date the instance was created and the launch date. I can't seem to figure out the expected syntax having put .Launchdate and .Created in various places within the command. Can anyone please help?
I have come up with the below that produces output (sadly, the same output) and I feel like this is a step in the direction I need to go in, but obvs it does not give the columns I want to see...
aws ec2 describe-instances | jq -r '.Reservations[]|.Instances[] | select(.LaunchTime > "2015-01-28")|[(.Tags[]?|select(.Key=="Name")|.Value), (.Tags[]?|select(.Key=="Group-Name")|.Value),.InstanceId,.PrivateIpAddress,.Launchtime.Value]|@csv'|sort