terraform-provider-dynatrace icon indicating copy to clipboard operation
terraform-provider-dynatrace copied to clipboard

encountering non-empty plans when deploying json dashboards

Open amsanmie opened this issue 7 months ago • 1 comments

Describe the bug Terraform keeps trying to update the contents of the json dashboards even if there are no changes in the code. My observation is that the content it keeps trying to add is part of the dashboard json code but it's not stored in the state file thereby causing the non-empty plans.

To Reproduce Steps to reproduce the behavior: Use any of the preset dashboards from this link https://github.com/Dynatrace/snippets/tree/master/product/dashboarding/aws-metric-streaming and attach the json file to the dashboard resource similar to below

resource "dynatrace_json_dashboard" "dashboard" { for_each = local.dashboard_files_classic

contents = each.value link_id = dynatrace_json_dashboard_base.dashboard_base[each.key].id

provider = dynatrace.dashboard }

dynatrace version 1.59.1

Expected behavior Terraform plan only shows changes when changes are made in the code as it should be.

Screenshots screenshot showing the code Screenshot 2024-07-23 at 16 47 19

Screenshot showing the terraform plan Screenshot 2024-07-23 at 16 46 32

Screenshot showing the state file, which indicate the dashboard filter being part of the code but not part of the state file Screenshot 2024-07-23 at 16 48 05

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here.

amsanmie avatar Jul 23 '24 15:07 amsanmie