When applying newrelic_nrql_alert_condition using Terraform 0.12 I get a terraform error about inconsistency:
Error: Provider produced inconsistent result after apply
When applying changes to
newrelic_nrql_alert_condition.lambda_invocations, provider
"registry.terraform.io/-/newrelic" produced an unexpected new value for was
present, but now absent.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.
I see 0.17 included a number of commits around alerts, but I've not been able to pinpoint a culprit
0.12.24 (only version of 12 I've tried)
I can't include these as they contain commercially sensitive information, but this is an approximation:
resource "newrelic_nrql_alert_condition" "lambda_invocations" {
policy_id = data.terraform_remote_state.shared.outputs.newrelic_alert_policy_id
name = "Lambda not invoked
term {
duration = 10
operator = "equal"
priority = "critical"
threshold = "0"
time_function = "all"
}
nrql {
query = "FROM AwsLambdaInvocation SELECT count(*) WHERE provider.functionName = '${local.lambda_name}'"
since_value = "5"
}
}
It should have applied the plan correctly
Terraform errorred with
Error: Provider produced inconsistent result after apply
When applying changes to
newrelic_nrql_alert_condition.lambda_invocations, provider
"registry.terraform.io/-/newrelic" produced an unexpected new value for was
present, but now absent.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.
Please list the steps required to reproduce the issue, for example:
We're having to workaround this by setting:
required_providers {
newrelic = "~> 1.16.0"
}
Looks like a bug in Paging was introduced in newrelic-client-go 0.20.0 where URLs handling was rebuild based on Region. https://github.com/newrelic/newrelic-client-go/pull/287
Can confirm using the latest provider 1.17.1 fixes this issue :)
Excellent! Thank you all for the report, testing and confirmation of resolution.
Most helpful comment
Looks like a bug in Paging was introduced in newrelic-client-go 0.20.0 where URLs handling was rebuild based on Region. https://github.com/newrelic/newrelic-client-go/pull/287