I have the following output of aws ec2 describe-vpcs
:
{
"Vpcs": [
{
"VpcId": "vpc-1f0e197d",
"InstanceTenancy": "default",
"Tags": [
{
"Value": "Product-Production",
"Key": "Name"
}
],
"CidrBlockAssociationSet": [
{
"AssociationId": "vpc-cidr-assoc-f3c5509a",
"CidrBlock": "172.19.0.0/16",
"CidrBlockState": {
"State": "associated"
}
}
],
"State": "available",
"DhcpOptionsId": "dopt-37fd5550",
"CidrBlock": "172.19.0.0/16",
"IsDefault": false
},
{
another vpc...
}
]
}
I'm using jq
to catch the "VpcId" if
.Tags[].Value==Product-Production
but no matter what I try, I can't get the right syntax, how can it be achieved?