Skip to content
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

State not accurate w/r/t splunk_saved_searches->alert_track #65

Closed
jsworkaccount opened this issue Mar 19, 2021 · 2 comments · Fixed by #64
Closed

State not accurate w/r/t splunk_saved_searches->alert_track #65

jsworkaccount opened this issue Mar 19, 2021 · 2 comments · Fixed by #64

Comments

@jsworkaccount
Copy link

Steps to reproduce:
TF version: 0.13.5
Provider version: 1.3.0 (also appears to be an issue in current)
Splunk version: 7.2.6

  1. Invoke a splunk_saved_searches resource, setting alert_track to true; e.g.,
resource "splunk_saved_searches" "mysearch" {
  name                      = "test"
  
 [...redacted parameters...]

  alert_comparator          = "greater than" 
  alert_digest_mode         = false 
  alert_threshold           = "0" 
  alert_severity            = "3" 
  alert_track               = true 
  alert_type                = "number of events" 
  is_scheduled              = true 
  acl {
    app     = "our_app"
    owner   = "our_owner"
    sharing = "app"
  }
}

  1. apply the configuration.
  2. run a terraform plan using the same configuration. If the problem persists, Terraform will think that the resource's alert_track value has changed. The tfstate file seems to believe that the actual value of alert_track is "", which is different from true. Excerpt from plan output follows:
# splunk_saved_searches.mysearch will be updated in-place
[...redacted...]
+ alert_track                 = "true"

This is problematic, because, if one terraform state is being used to manage a large number of searches, a terraform apply will attempt to update every resource that has an explicit alert_type definition - and will also fail if any one of those updates fails for any reason (such as a timeout). It also increases the runtime of a terraform apply (particularly when only one resource is being changed, within a large state). Attempting to invoke the same without alert_type defined does not seem to yield alert_type = true as a default in the above-documented environment.

@anushjay anushjay linked a pull request Mar 19, 2021 that will close this issue
@anushjay
Copy link
Collaborator

@jsworkaccount Yeah, that was a bug. Fixed it and it should be available in the next release.

@anushjay
Copy link
Collaborator

Fix in v1.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants