I'm trying to use the following jq command to return a true output, if any of one of the condition is true in the list.
.Tags[] as $t| "aws:cloudformation:stack-name"| IN($t[])
Input
{
"Tags": [{
"Value": "INF-D-XX-SEC-OPNV-UW1",
"Key": "Name"
},
{
"Value": "INF-D-XX-CFS-StandardInfrastructure-UW1",
"Key": "aws:cloudformation:stack-name"
},
{
"Value": "sgOpenVPNAccess",
"Key": "aws:cloudformation:logical-id"
},
{
"Value": "UW1",
"Key": "Location"
},
{
"Value": "INF",
"Key": "Application"
},
{
"Value": "D",
"Key": "Parent Environment"
},
{
"Value": "arn:aws:cloudformation:us-west-1:111111:stack/INF-D-XX-CFS-StandardInfrastructure-UW1/1111-11-11e8-96fe-11",
"Key": "aws:cloudformation:stack-id"
},
{
"Value": "OPNV",
"Key": "ResourceType"
}
]
}
This gave me a list of returned boolean values back as the following,
--output--
true
false
false
false
false
false
false
I would like to return a single value true
if one of the
Key="aws:cloudformation:stack-name"
is detected and without given me a list of value back.