Hi all, I can’t seem to reproduce this. What version of the provider is being used? v1.16.x?
Some of what I bring up below has been mentioned, please excuse my redundancy.
This indeed sounds like an incorrect/invalid/permissions issue. From what I’ve gathered, it could be one of three scenarios - could be permissions (user role), could be personal API key being used for
NEWRELIC_API_KEY, or could be the admin API key being used for
NEWRELIC_PERSONAL_API_KEY requires using the API key provided at the following URL:
https://account.newrelic.com/accounts/<account id>/users/<user id>.
Double check your account’s users at
https://account.newrelic.com/accounts/<account id>/users. You’ll see the users’ roles here and can confirm if the user has the Admin role.
NEWRELIC_API_KEY requires using the API key provided at the following URL:
https://rpm.newrelic.com/accounts/<account id>/integrations?page=api_keys. If the user doesn’t have the Admin or Owner role, the user will not be able to view this page.
Also of note, a few different 401 error scenarios could be encountered (not necessarily limited to what’s mentioned below). What was the full message of the 401 error that was returned?
If you received the error message, “Error: 401 response returned: The API key provided is invalid”, then it might be a situation of the wrong key being used for one of the variables.
If you received the error message, “Error: 401 response returned: User does not have permission”, then the user does not have the Admin role or Owner role, which is required.
For the first error message scenario, if your user has the Admin role assigned, you can use your personal API key (from this URL:
https://account.newrelic.com/accounts/<account id>/users/<user id> - click the API Keys tab) and would use this key to set
If your situation falls into the second scenario, you’ll need to ask an Admin user to increase your role or you’ll need your account’s Admin user’s Admin API key (from this URL:
https://rpm.newrelic.com/accounts/<account url>/integrations?page=api_keys) and would use this key to set
Apologies for the long response. Hope this helps. If not, we might need a bit more context to see what’s going on.