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

Empty string values are not being set #35

Open
zscholl opened this issue Nov 16, 2020 · 1 comment
Open

Empty string values are not being set #35

zscholl opened this issue Nov 16, 2020 · 1 comment
Assignees

Comments

@zscholl
Copy link
Contributor

zscholl commented Nov 16, 2020

It seems that if you want to clear out a value using an empty string that the provider is not updating Splunk.

Here's an example of a failing test when using an empty string: #34

resource "splunk_saved_searches" "test" {
    name = "[Test New Alert]"
    search = "index=main"
    actions = "email"
    action_email_include_search = 1
    action_email_include_trigger = 1
    action_email_format = "table"
    action_email_max_time = "5m"
    action_email_max_results = 100
    action_email_send_csv = 1
    action_email_send_results = false
    action_email_subject = ""
    action_email_to = "splunk@splunk.com"
    action_email_track_alert = true
    dispatch_earliest_time = "rt-15m"
    dispatch_latest_time = "rt-0m"
    dispatch_index_earliest = "-20m"
    dispatch_index_latest = "-5m"
    cron_schedule = "*/15 * * * *"
    acl {
      owner = "admin"
      sharing = "app"
      app = "launcher"
    }
}
@anushjay anushjay self-assigned this Jan 7, 2021
@anushjay
Copy link
Collaborator

@zscholl
I looked into this and according to Terraform, if an argument is set to null or empty, or being omitted Terraform will use the argument's default value. In this case, the argument is optional which is why I believe terraform is not capturing the change of state or value of the argument.
(https://www.terraform.io/docs/configuration/expressions/types.html)
We can either have a default value for argument or If you want to try setting the action_email_subject to an empty space that should work as well. Let me know your thoughts.

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

No branches or pull requests

2 participants