elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.48k stars 8.04k forks source link

[ResponseOps][Rules] Extend the TerraForm provider to support the new capabilities of the Create Rule API #186963

Open cnasikas opened 1 week ago

cnasikas commented 1 week ago

The Elastic TerraForm provider allows users to create rules using TerraForm. It uses the Create Rule API to create rules. The API evolved over time to support new features but the TF provider fell behind. We should update the TF provider to support the new capabilities.

The current model of the rule: https://github.com/elastic/terraform-provider-elasticstack/blob/eb077fd2993321ec813222c317aed0a831c6f073/internal/models/alert_rule.go

The current request schema of the Create rule API: https://github.com/elastic/kibana/blob/ac9f6233eb6675c6d5db7cef80817a4698543653/x-pack/plugins/alerting/docs/openapi/components/schemas/create_rule_request.yaml

Related: https://github.com/elastic/terraform-provider-elasticstack/issues/591

### DoD
- [ ] Add support for the `alert_delay` attribute of the rule
- [ ] Add support for the `frequency` attribute of the action
- [ ] Add support for the `alerts_filter` attribute of the action
- [ ] Verify that all attributes of the rule and the action are supported
- [ ] Adding the new attributes does not introduce breaking changes to existing TF configurations
- [ ] The new TF definition is BWC with Elastic Stack versions 7.x+
- [ ] Update the Elastic TerraForm provider [docs](https://registry.terraform.io/providers/elastic/elasticstack/latest/docs)
elasticmachine commented 1 week ago

Pinging @elastic/response-ops (Team:ResponseOps)

shanisagiv1 commented 1 day ago

see also relates issues to Terraform, lets make sure we fix all issues with this effort. @cnasikas thanks!! https://github.com/elastic/kibana/issues/178969 https://github.com/elastic/terraform-provider-elasticstack/issues/524