I am receiving below error while pushing rules to new relic using terraform
INVALID_PARAMETER: The parameter provided does not correspond to any valid entity[0m
with newrelic_notification_channel.cloudops,
on main.tf line 300, in resource "newrelic_notification_channel" "PD_TEST":
300: resource "newrelic_notification_channel" "PD_Channel"
Entities' types do not match
I am using below code:
resource "newrelic_notification_channel" "PD_Channel" {
name = "pagerduty-channel-production"
type = "PAGERDUTY_SERVICE_INTEGRATION"
destination_id = "8dasd-asdad-adsadsa-xxxx"
product = "IINT"
property {
key = "summary"
value = "{{ annotations.title.[0] }}"
}
property {
key = "customDetails"
value = <<-EOT
{
"id":{{json issueId}},
"IssueURL":{{json issuePageUrl}},
"NewRelic priority":{{json priority}},
"Total Incidents":{{json totalIncidents}},
"Impacted Entities":"{{#each entitiesData.names}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
"Runbook":"{{#each accumulations.runbookUrl}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
"Description":"{{#each annotations.description}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
"isCorrelated":{{json isCorrelated}},
"Alert Policy Names":"{{#each accumulations.policyName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
"Alert Condition Names":"{{#each accumulations.conditionName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
"Workflow Name":{{json workflowName}}
}
EOT
}
}
I am pushing NR alerts using terraform and here I am trying to create Pagerduty details
The error is that you are trying to create this channel in relation to a destination who’s type is not PAGERDUTY_SERVICE_INTEGRATION
You can verify the destination type via nerdgraph