Description
Feature Description
When I want to create a new API Key for my own user (key type: USER
), I have to give user_id
, but it's not possible to get it while having Full platform user
. Only Admin
can do this (I tried this https://docs.newrelic.com/docs/apis/rest-api-v2/account-examples-v2/listing-users-your-account/).
Of course, I can find my user_id
by data source, but it requires authentication_domain_id
which is also not available for me as Full platform user
.
Please, create another resource (e.g. newrelic_user_current
) which returns the user object for the credentials that are currently used by Terraform.
Describe Alternatives
It's probably a bug, because I can find my user ID by:
- Manually create API key (type:
USER
) in New Relic UI. - Write code for the above resource (
resource "newrelic_api_access_key" "...."
), but don't useuser_id
argument. - Import the above resource to the Terraform state.
- Read the
user_id
from the state (e.g. as JSON).
Now, you can use user_id
in the other newrelic_api_access_key
resources.
Using the above way, you can get a User ID of any other user. The only need is to be able to see API Keys in New Relic UI.