-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Description
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: elastic/terraform-provider-elasticstack#591, #186963, https://github.com/elastic/enhancements/issues/22130, https://github.com/elastic/enhancements/issues/22131, https://github.com/elastic/enhancements/issues/22129
### DoD
- [x] Add support for the `alert_delay` attribute of the rule (https://github.com/elastic/terraform-provider-elasticstack/pull/715)
- [x] Add support for the `frequency` attribute of the action (https://github.com/elastic/terraform-provider-elasticstack/pull/753)
- [x] Add support for the `alerts_filter` attribute of the action (https://github.com/elastic/terraform-provider-elasticstack/pull/774)
- [x] Verify that all attributes of the rule and the action are supported
- [x] Adding the new attributes does not introduce breaking changes to existing TF configurations
- [x] The new TF definition is BWC with Elastic Stack versions 7.x+
- [x] Update the Elastic TerraForm provider [docs](https://registry.terraform.io/providers/elastic/elasticstack/latest/docs)