I am trying to get the JMES query to give me only items which have a Tag
with Name
matching Value
of match
.
So far I have GlobalNetworks[].[Tags[?Key==
Name && Value==
match]]
but that gives me the non-matching one too. I also only want the GlobalNetworkId
of the matching item(s) with a projection
Can someone help please?
{
"GlobalNetworks": [
{
"GlobalNetworkId": "abc",
"GlobalNetworkArn": "arn:aws:networkmanager::xxx:global-network/global-network-1",
"CreatedAt": "2023-07-11T23:13:58+12:00",
"State": "AVAILABLE",
"Tags": [
{
"Key": "Name",
"Value": "match"
}
]
},
{
"GlobalNetworkId": "def",
"GlobalNetworkArn": "arn:aws:networkmanager::xxx:global-network/global-network-2",
"CreatedAt": "2023-07-11T23:13:58+12:00",
"State": "AVAILABLE",
"Tags": [
{
"Key": "Name",
"Value": "nomatch"
}
]
},
{
"GlobalNetworkId": "ghi",
"GlobalNetworkArn": "arn:aws:networkmanager::xxx:global-network/global-network-3",
"CreatedAt": "2023-07-11T23:13:58+12:00",
"State": "AVAILABLE",
"Tags": [
{
"Key": "Name",
"Value": "match"
}
]
}
]
}