-
Notifications
You must be signed in to change notification settings - Fork 122
Add support for thefrequency
field in the Create Rule API
#753
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
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.
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.