【jq】 JSON の値代入

$ cat << __EOS__ | jq ".Workspaces[].DirectoryId=\"hoge\" | (.Workspaces[].Tags[] | select(.Key == \"Name\") | .Value) |= \"fuga\""
> {
>     "Workspaces": [
>         {
>             "DirectoryId": "{{ws_directory_id}}",
>             "Tags": [
>                 {
>                     "Key": "Name",
>                     "Value": "{{workspace_name_tag}}"
>                 },
>                 {
>                     "Key": "Type",
>                     "Value": "Prod"
>                 }
>             ]
>         }
>     ]
> }
> __EOS__
{
  "Workspaces": [
    {
      "DirectoryId": "hoge",
      "Tags": [
        {
          "Key": "Name",
          "Value": "fuga"
        },
        {
          "Key": "Type",
          "Value": "Prod"
        }
      ]
    }
  ]
}

参考