We currently send application logs to nine OpenSearch instances. Most saved objects and dashboards are identical, but the namespaces and index names differ between instances. I'd like to manage the dashboards and related objects in Git and deploy updates consistently. Is Terraform a good fit, or would a CI pipeline that templates the configuration and uses the OpenSearch API to import or update saved objects be more practical?
3 Answers
Terraform is probably the cleanest option here. The OpenSearch provider can manage dashboard objects, so the definitions and environment-specific values can live in version control and be applied consistently to each instance.
A CI deployment approach works well too, but treat the exported dashboard as a generated artifact rather than the source of truth. Keep a small configuration file containing tenant, namespace, and index-pattern values, generate the final saved-object JSON or NDJSON in the pipeline, and import it into a staging instance before deploying to all nine. Be careful with saved-object IDs, since changing them can break links between dashboards, visualizations, and panels.
If possible, make the index patterns consistent across every instance by using aliases. Then the same exported NDJSON can be committed to Git and imported everywhere without much environment-specific templating. That removes a lot of complexity and makes the deployment pipeline easier to validate.

That sounds like a good direction. I’ll look into using the provider to keep the dashboard definitions and per-instance settings together.