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

start is marked as optional in docs but it seems to be required? (datadog_downtime) #507

Closed
red8888 opened this issue May 8, 2020 · 1 comment · Fixed by #597
Closed
Labels

Comments

@red8888
Copy link

red8888 commented May 8, 2020

Terraform v0.12.12

  • provider.datadog v2.7.0

I want to mute a monitor indefinitely so I do this:

resource "datadog_downtime" "test" {
  scope = ["*"]
  monitor_id = datadog_monitor.testsdfsdfds.id
  // Mute now and forever
  active = true
}

In never comes into state, every time I apply I see this:

  ~ resource "datadog_downtime" "test" {
        active     = true
        disabled   = false
        end        = 0
        id         = "123456"
        monitor_id = 212312312
        scope      = [
            "*",
        ]
      - start      = 1588945921 -> null
        timezone   = "UTC"
    }

While I can do this, its strange. Requiring ignore of a property as part of normal behaviour I think is poor form, or should I say poor... terra-form HA!

  lifecycle {
    ignore_changes = ["start"]
  }

I would characterize this as a bug. If active is set with the absence of start, start should just not be checked at all. Maybe Im missing something here

@bendrucker
Copy link
Contributor

Hi, this should be a fixable bug. If start has a current value and the previous value is null, the resource can be considered unchanged. The direct way to accomplish this would be with a DiffSuppressFunc for that field.

Why does this behavior need to depend on active though?

You can make these changes here, btw, if you're inclined to submit a PR:

https://github.com/terraform-providers/terraform-provider-datadog/blob/master/datadog/resource_datadog_downtime.go

@gzussa gzussa self-assigned this Jun 23, 2020
therve added a commit that referenced this issue Jul 24, 2020
If the start attributes generates a diff from a value to nothing, it
means that the attribute was never set to being with. Let's ignore the
diff in that case.

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

Successfully merging a pull request may close this issue.

4 participants