IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
339 stars 663 forks source link

ibm_logs_view resource is always refreshed #5655

Open andreainnocenti opened 1 day ago

andreainnocenti commented 1 day ago

Community Note

Terraform CLI and Terraform IBM Provider Version

Affected Resource(s)

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "ibm_logs_view" "foo" {
  instance_id = var.cloud_logs_instance_guid
  region      = var.cloud_logs_instance_location
  name        = "foo"
  search_query {
    query = "bar"
  }
  time_selection {
    quick_selection {
      caption = "Last 24 hours"
      seconds = 86400
    }
  }

  folder_id = ibm_logs_view_folder.folder.view_folder_id
}

Debug Output

Panic Output

Expected Behavior

Do not modify resources every time

Actual Behavior

Screenshot 2024-09-18 at 16 29 55

As you can see in the screen, quick_selection is always converted to custom_selection using the current time.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

andreainnocenti commented 1 day ago

As workaround, customer can use this feature https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#ignore_changes

  lifecycle {
    ignore_changes = [
      time_selection,
    ]
  }