I can't use environment variables inside a string in jmespath. Using a wildcard could have also worked but it didn't work in my case either. Any leads on this issue would be appreciated thanks!
aws logs describe-log-groups | jq -r --arg CLUSTER_NAME "$EKS_CLUSTER_NAME" '.logGroups[] | select(.logGroupName == '/aws/eks/$CLUSTER_NAME/cluster')'
Output:
jq: error: syntax error, unexpected '/' (Unix shell quoting issues?) at <top-level>, line 1:
.logGroups[] | select(.logGroupName == /aws/eks//cluster)
jq: 1 compile error