Skip to content

grafana_message_template: plan fails if template string begins or ends with an emtpy line #2616

@moorglade

Description

@moorglade

Terraform Version

1.14.7

Terraform Grafana Provider Version

4.28.1

Grafana Version

12.4.1

Affected Resource(s)

  • grafana_message_template

Terraform Configuration Files

resource "grafana_message_template" "test1" {
  name               = "test 1"
  template           = "\ntest"
}

resource "grafana_message_template" "test2" {
  name               = "test 2"
  template           = "test\n"
}

Expected Behavior

Template should be correctly provisioned in Grafana.

Actual Behavior

Terraform crashes while preparing the plan:

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: Provider produced invalid plan
│
│ Provider "registry.terraform.io/grafana/grafana" planned an invalid value for grafana_message_template.test1.template: planned value cty.StringVal("test") does not match config value cty.StringVal("\ntest").
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Steps to Reproduce

  1. terraform plan

Important Factoids

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions