We currently send application logs to nine OpenSearch instances. The saved objects and dashboards are almost identical across them, but each instance uses different namespaces or index names. What's the most maintainable way to manage these dashboards and keep them synchronized? Ideally, I'd like the definitions stored in Git and deployed automatically, possibly through a GitLab CI job, but I'm unsure whether there's a better approach than templating the objects and importing or updating them through the OpenSearch API.
3 Answers
Terraform is a good fit here. The OpenSearch provider includes resources for managing dashboard objects, so you can keep the configuration in version control and apply it consistently to each instance. It also gives you a clearer change history than manually importing saved objects.
A CI pipeline can work well if you treat the exported dashboard as a generated artifact rather than the source of truth. Keep a small configuration file containing the namespace, index-pattern, and tenant-specific values, generate the final OpenSearch objects during the pipeline, and import them into a staging instance first. Once that succeeds, deploy to the remaining instances. Be careful with saved-object IDs, since changing them can break links between dashboards and panels.
If possible, make the index patterns consistent across all instances by using aliases. Then the same saved-object export can often be reused everywhere without much templating. You can export the objects as NDJSON through the saved-objects API, commit that file to Git, and have the runner import the identical version into each instance.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures