Hello
I am trying to create a Dashboard following this guide Creating dashboards with Terraform and JSON templates | New Relic
After setting everything up I run terraform init, and then apply!
Terraform runs, the dashboard gets created correctly in NW BUT the logs are problematic.
I get an error saying
newrelic_one_dashboard_json.learn_dashboard: Creating...
╷
│ Error: entity not found. GUID: 'XXXXXQ3MjkXXX'
│
│ with newrelic_one_dashboard_json.learn_dashboard,
│ on dashboard.tf line 1, in resource "newrelic_one_dashboard_json" "learn_dashboard":
│ 1: resource "newrelic_one_dashboard_json" "learn_dashboard" {
│
And If I try to RE run it again, without destroying it I get
terraform apply -var-file="variables.tfvars"
newrelic_one_dashboard_json.learn_dashboard: Refreshing state... [id=XXXXXQ3MjkXXX]
Note: Objects have changed outside of Terraform
Terraform detected the following changes made outside of Terraform since the last "terraform apply" which may have affected this plan:
# newrelic_one_dashboard_json.learn_dashboard has changed
~ resource "newrelic_one_dashboard_json" "learn_dashboard" {
+ guid = "XXXXXQ3MjkXXX"
id = "XXXXXQ3MjkXXX"
+ permalink = "https://one.eu.newrelic.com/redirect/entity/XXXXXQ3MjkXXX"
# (1 unchanged attribute hidden)
}
Unless you have made equivalent changes to your configuration, or ignored the relevant attributes using ignore_changes, the following plan may include actions to undo or respond to
these changes.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
-/+ destroy and then create replacement
Terraform will perform the following actions:
# newrelic_entity_tags.learn_dashboard will be created
+ resource "newrelic_entity_tags" "learn_dashboard" {
+ guid = (known after apply)
+ id = (known after apply)
+ tag {
+ key = "terraform"
+ values = [
+ "true",
]
}
}
# newrelic_one_dashboard_json.learn_dashboard is tainted, so must be replaced
-/+ resource "newrelic_one_dashboard_json" "learn_dashboard" {
~ account_id = XX -> (known after apply)
~ guid = "XXXXXQ3MjkXXX" -> (known after apply)
~ id = "XXXXXQ3MjkXXX" -> (known after apply)
~ permalink = "https://one.eu.newrelic.com/redirect/entity/XXXXXQ3MjkXXX" -> (known after apply)
~ updated_at = "2025-01-31T17:26:51Z" -> (known after apply)
# (1 unchanged attribute hidden)
}
I can’t really spot what I am doing wrong!