fix(opensearch): grant the search indexer cluster-level indices:data/read/mget
Problem
OpenSearch checks _mget at the cluster level, the same way it checks _bulk. The documented relayhistory_indexer role grants indices:data/read/mget* only on the index pattern. That role appears in terraform/modules/aws/search/README.md and in the FGAC remedy printed by diagnose-install.py. With it, the indexer's tombstone check (packages/pipeline/src/search-index/opensearch.ts, deletedOnly, which runs after a _bulk version conflict) is refused.
Seen on the 2026.11.22 AA rehearsal on EKS, where the role was created from the documented body:
"message":"search index failed","stage":"search-index","session_id":"e2e-ā¦-session","error_code":"unavailable","retryable":false,"error_detail":"http_403:security_exception"
The error repeated on each consumer tick for erased sessions. I reproduced it with a no-op signed probe sent as the indexer's own Pod Identity role:
POST relayhistory-transcript-events/_mget -> 403 no permissions for [indices:data/read/mget] and User [name=arn:aws:iam::ā¦:role/pippen/runtime/ā¦-search-indexer, ā¦]
POST relayhistory-transcript-events/_search, /_refresh, /_delete_by_query -> 200
First-time indexing is unaffected: a fresh session indexed 4/4 docs.
Fix
- Add
indices:data/read/mgetto the role'scluster_permissionsin the terraform search README and in the diagnose-install remedy. - Explain in the README why the indexer needs it.
- Pin it in
test_diagnose_install.py.
Not verified
- The amended role has not been applied to a live domain yet. I didn't change the rehearsal domain's security config. To verify, re-PUT the role on
pippen-sbx-aa-searchand confirm the_mgetprobe returns 200 and the erased-sessionsearch index failedlines stop. diagnose-install --only searchonly probesGET /_cluster/health, so it reported PASS on this install. It can't catch a missing cluster-level_mget.
On hold (merge-train:hold) until Khaliq reviews.
š¤ Generated with Claude Code
Open in [code]smith Ā· Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Grants the search indexer cluster-level indices:data/read/mget so its tombstone check after a _bulk version conflict no longer returns 403.
- OpenSearch authorizes
_mgetat cluster level, like_bulk; the documentedrelayhistory_indexerrole only granted it on the index pattern, so erasing a session made its search-index stage fail withhttp_403:security_exceptionon every consumer tick. - Adds the permission to
cluster_permissionsin the terraform search README and in thediagnose-install.pyFGAC remedy, and pins it intest_diagnose_install.py.
Migration
- Re-PUT the role on existing domains from the amended role body to clear the 403s; first-time indexing is unaffected.