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

[Bug]: Changes to Report Schedule Start Time are not Detected #1452

Open
SeamusGrafana opened this issue Mar 28, 2024 · 1 comment
Open

[Bug]: Changes to Report Schedule Start Time are not Detected #1452

SeamusGrafana opened this issue Mar 28, 2024 · 1 comment

Comments

@SeamusGrafana
Copy link

Terraform Version

1.7.4

Terraform Grafana Provider Version

2.14.3

Grafana Version

Grafana v11.0.0-67348 (778d80f922

Affected Resource(s)

  • grafana_report

Terraform Configuration Files

resource "grafana_report" "mythical_overview" {
  provider = grafana.stack

  name = "Mythical Services - Endpoint Latency Overview"
  dashboards {
    uid = "ed4f4709-4d3b-48fd-a311-a036b85dbd5x"
  }
  dashboards {
    uid = "d3c52c67-4e86-4e7d-9377-ae04f5d742f6"
  }
  recipients = ["REMOVED"]
  schedule {
    frequency  = "daily"
    start_time = "2006-01-02T07:45:00"
  }
}

Expected Behavior

When the Start Time is changed, it should be reflected in a Terraform Plan and the Applied on Apply updating the Start Time in the Repo

Actual Behavior

When you change the start_time value e.g. from 07:45 to 07:00, and run a Terraform Plan/Apply no changes are detected.

Steps to Reproduce

  • Define a Grafana Provider and add relevant credentials.
  • Create a Terraform Configuration using the above config (editing Email and Dashboards as required)
  • Plan and Apply the changes
  • Verify Report is created and Start time is correct
  • Change Start Time in Report e.g 07:45 to 07:30
  • Run a Terraform Plan
  • Observe No Changes Detected

Important Factoids

Changing the Start Date to a future Date does not help either, e.g. 2024-04-29T07:45:00

Logs;

2024-03-28T16:09:26.545Z [DEBUG] ReferenceTransformer: "grafana_report.mythical_overview" references: []
grafana_report.mythical_overview: Refreshing state... [id=1:1]
2024-03-28T16:09:27.177Z [WARN]  Provider "registry.terraform.io/grafana/grafana" produced an invalid plan for grafana_report.mythical_overview, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .layout: planned value cty.StringVal("grid") for a non-computed attribute
      - .org_id: planned value cty.StringVal("1") for a non-computed attribute
      - .reply_to: planned value cty.StringVal("") for a non-computed attribute
      - .include_dashboard_link: planned value cty.True for a non-computed attribute
      - .include_table_csv: planned value cty.False for a non-computed attribute
      - .message: planned value cty.StringVal("") for a non-computed attribute
      - .orientation: planned value cty.StringVal("landscape") for a non-computed attribute
      - .dashboards[0].report_variables: planned value cty.MapValEmpty(cty.String) for a non-computed attribute
      - .dashboards[0].time_range: block count in plan (1) disagrees with count in config (0)
      - .dashboards[1].report_variables: planned value cty.MapValEmpty(cty.String) for a non-computed attribute
      - .dashboards[1].time_range: block count in plan (1) disagrees with count in config (0)
      - .schedule[0].last_day_of_month: planned value cty.False for a non-computed attribute
      - .schedule[0].timezone: planned value cty.StringVal("GMT") for a non-computed attribute
      - .schedule[0].workdays_only: planned value cty.False for a non-computed attribute
      - .schedule[0].custom_interval: planned value cty.StringVal("") for a non-computed attribute
      - .schedule[0].end_time: planned value cty.StringVal("") for a non-computed attribute

References

No response

@julienduchesne
Copy link
Member

Indeed, the data format without a timezone is a bit broken. Add timezone info to your date and it will work as expected. Example: 2024-04-29T07:45:00Z or 2024-04-29T07:45:00-04:00

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

No branches or pull requests

2 participants