terraform-provider-newrelic
terraform-provider-newrelic copied to clipboard
newrelic_api_access_key throws APIAccessKeyErrorInterface
Hello
I am trying to create a newrelic_api_access_key
this way:
resource "newrelic_api_access_key" "my_key" {
account_id = 123456
key_type = "INGEST"
ingest_type = "LICENSE"
name = "my_key"
}
but when I terraform apply
I get:
Error: json: cannot unmarshal object into Go struct field .data.apiAccessCreateKeys.errors of type apiaccess.APIAccessKeyErrorInterface
My setup:
- terraform v0.12.31
- NewRelic provider ~> 2.24.1
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs.
This issue has been automatically closed due to a lack of activity for an extended period of time.
hi @andrea-cuttone Thanks for your patience on this.
I haven't been able to reproduce this, and since its' been a long time I'll close this issue.
Please reply in this ticket if this is still a problem for you with the latest version.
Thanks a lot
Hi,
I've come across this issue. This is the response I believe cannot be unmarshalled:
{
"data": {
"apiAccessCreateKeys": {
"createdKeys": null,
"errors": [
{
"accountId": account-id,
"id": null,
"ingestErrorType": "FORBIDDEN",
"ingestType": "LICENSE",
"message": "You do not have permission to create this key.",
"type": "INGEST"
}
]
}
}
}
It would be nice if this error could be correctly unmarshalled, instead of getting an exception.
Terraform v1.1.9
on linux_amd64
+ provider registry.terraform.io/newrelic/newrelic v2.46.1
Thanks @xorxsan We'll take a look
We also got this error, with Terraform 1.2.3 and New Relic 2.46.0. I don't know how to track down the details of the response like the above commenter did, but with that clue I found an authentication problem in our configuration, and fixing it unblocked us. So our error response probably looked a lot like that one. :)