Skip to content

Improve IaC for Elastic.

This is not a fully fleshed out issue, this is a dumping ground of all the things I know that we probably need to do to improve our management of Elastic over all.

  1. Set up deployment management using the terraform provider -- https://registry.terraform.io/providers/elastic/ec/latest/docs. This would cover some of the 'clicky button' changes on the UI. This would involve creating the terraform details for the clusters, and then importing all the current resources into the state file. Level of effort: Low
  2. Set up cluster management using the terraform provider -- https://registry.terraform.io/providers/elastic/elasticstack/latest/docs/guides/elasticstack-and-cloud. This would replace all the jsonnet in https://gitlab.com/gitlab-com/runbooks/-/tree/master/elastic?ref_type=heads, plus manage rules, users and things like oauth settings, all of which are not managed by IaC today. Unfortunately, this would also be a HUGE level of effort to painstakingly go through and set up everything in terraform one piece by one piece so that we don't break the clusters in the process.
  3. All the other stuff(tm). Dashboards cannot be created with the terraform provider (https://github.com/elastic/terraform-provider-elasticstack/issues/650) nor can advanced settings (https://github.com/elastic/terraform-provider-elasticstack/issues/709) and I'm certain we'll find more things. If we want to fully do this in IaC, we'd need to likely jsonnet and API call our way through all the rest of the things we've set off default. Level of effort: Medium, but likely can only be done once level 2 is complete.

Those three things would get us to a point where we're mostly hands-off on managing Elastic, and everything (or close to everything) would be done through terraform.