BetterStackHQ / terraform-provider-better-uptime

Apache License 2.0
48 stars 14 forks source link

Status page password gets re-set on each run #15

Closed sampsakuronen closed 2 years ago

sampsakuronen commented 2 years ago

Using password for betteruptime_status_page causes Terraform to always set the password even though it has been previously applied and hasn't changed.

Output when terraform plan is run which has password:

Terraform used the selected providers to generate the following
execution plan. Resource actions are indicated with the following
symbols:
  ~ update in-place

Terraform will perform the following actions:

  # betteruptime_status_page.status_page will be updated in-place
  ~ resource "betteruptime_status_page" "status_page" {
        id                         = "123456"
      + password                   = "secret-password"
        # (10 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

We needed to add a lifecycle rule to avoid this on each run:

lifecycle {
  ignore_changes = [
    password
  ]
}

Our resource is created like this:

resource "betteruptime_status_page" "status_page" {
  company_name             = "Example ompany"
  company_url              = "https://www.examplecompany.com/"
  timezone                 = "wanted-zone"
  subdomain                = "subdomain"
  custom_domain            = "status.examplecompany.com"
  hide_from_search_engines = true
  subscribable             = true
  password_enabled         = true
  password                 = "secret-password"

  lifecycle {
    ignore_changes = [
      password
    ]
  }
}
sampsakuronen commented 2 years ago

https://github.com/BetterStackHQ/terraform-provider-better-uptime/pull/14