-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for thefrequency
field in the Create Rule API
#753
Conversation
examples/resources/elasticstack_kibana_alerting_rule/resource_rule_action_frequency.tf
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not update the TestAccResourceAlertingRule tests in internal/kibana/alerting_test.go because this new field needs the actions block that requires the ID of an existing connector.
IIRC alert management was implemented before connector management. Now that we have the connector resource I think we should update the acceptance tests to create say a server_log connector so we can reference that in the actions. WDYT?
Ah nice, I hadn't noticed the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Let's add a note about notify_when
being required in 8.5 and lower and add some validation in the resource code itself enforcing that.
…-data-source * origin/main: (23 commits) Migrate index resource to plugin framework (elastic#698) Remove duplicate code (elastic#761) fix(deps): update module github.com/hashicorp/terraform-plugin-framework-jsontypes to v0.2.0 (elastic#760) fix(deps): update module github.com/golangci/golangci-lint to v1.61.0 (elastic#759) Add support for the`frequency` field in the Create Rule API (elastic#753) Prevent a provider panic when the referenced snapshot repo does not exist (elastic#758) remove space_id paramter from private locations (elastic#733) chore(deps): update dependency go to v1.23.1 (elastic#755) chore(deps): update docker.elastic.co/elasticsearch/elasticsearch docker tag to v8.15.1 (elastic#756) chore(deps): update golang:latest docker digest to 4a3c2bc (elastic#754) chore(deps): update docker.elastic.co/kibana/kibana docker tag to v8.15.1 (elastic#757) Fixup error handling during saved object imports (elastic#738) fix(deps): update module github.com/goreleaser/goreleaser to v2 (elastic#748) chore(deps): update golangci/golangci-lint-action action to v6 (elastic#746) chore(deps): update codecov/codecov-action action to v4 (elastic#745) fix(deps): update module github.com/go-resty/resty/v2 to v2.14.0 (elastic#741) chore(deps): update actions/setup-go action to v5 (elastic#744) chore(deps): update actions/checkout action to v4 (elastic#743) fix(deps): update module github.com/deepmap/oapi-codegen/v2 to v2.3.0 (elastic#740) chore(deps): update dependency go to v1.23.0 (elastic#739) ...
related to kibana/#186963
Summary
As a follow-up to what was done in #715 I am now adding support for another field.
Testing notes
I could not update the
TestAccResourceAlertingRule
tests ininternal/kibana/alerting_test.go
because this new field needs theactions
block that requires the ID of an existing connector.(We already supported the
actions
field but those were not included in the tests in the initial PR and I think the reasoning was the same. Maybe @tobio knows?).To test I started Kibana locally and configured an MS Teams connector manually.
I then updated the test resources with the new fields and my connector ID and ran
make testacc TESTARGS='-run ^TestAccResourceAlertingRule$$'
, which worked as expected.Additionally, I added the file
resource_rule_action_frequency.tf
and tested it with Terraform CLI. (I substitutedelasticstack_kibana_action_connector.index_example.connector_id
for my connector ID).I also updated the tests in
internal/clients/kibana/alerting_test.go
to include all possible combinations of the new fields in the Rule API responses.