Open VenelinMartinov opened 3 weeks ago
Hi @VenelinMartinov, I've had a word with my team, and it appears that this is an access issue surfacing from the API (the error thrown by the API is being shown by the Terraform Provider). Can you try creating other resources such as alerts, dashboards, workflows etc. with the same credentials and let us know if you're seeing this issue only with the resource you've reported this with? If this isn't the case and you're seeing similar access restricted errors with other resources too, you might need to use an active, right set of credentials; if not, and you're seeing the issue only with this resource, I'll see what we can do about this issue further. Thanks!
Hey @pranav-new-relic, thanks for getting back to me. It seems to be specific to the resource. I could run the following code fine with the same set of credentials:
terraform {
required_version = "~> 1.0"
required_providers {
newrelic = {
source = "newrelic/newrelic"
}
}
}
resource "newrelic_alert_policy" "foo" {
name = "example"
incident_preference = "PER_POLICY" # PER_POLICY is default
}
Hi there,
Thank you for opening an issue. In order to better assist you with your issue, we kindly ask to follow the template format and instructions. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests only. General usage questions submitted as issues will be closed and redirected to New Relic's Explorers Hub https://discuss.newrelic.com/c/build-on-new-relic/developer-toolkit.
Please include the following with your bug report
provider
configuration (sensitive details redacted)Terraform Version
Run
terraform -v
to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.v1.9.5
Affected Resource(s)
Please list the resources as a list, for example:
newrelic_notification_destination
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Terraform Configuration
resource "newrelic_notification_destination" "foo" { account_id = 12345678 name = "foo" type = "WEBHOOK"
secure_url { prefix = "https://webhook.mywebhook.com/" secure_suffix = "service_id/123456" }
property { key = "source" value = "terraform" } }
Plan: 1 to add, 0 to change, 0 to destroy. newrelic_notification_destination.foo: Creating... ╷ │ Error: Access restricted │ │ with newrelic_notification_destination.foo, │ on main.tf line 12, in resource "newrelic_notification_destination" "foo": │ 12: resource "newrelic_notification_destination" "foo" { │ │ NOTICE: fields are statically typed. Make sure all fields are of the correct type ╵ Error: exit status 1