Skip to content

Add resource to get User ID of currently used user #2596

Open
@thevops

Description

@thevops

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:

  1. Manually create API key (type: USER) in New Relic UI.
  2. Write code for the above resource (resource "newrelic_api_access_key" "...."), but don't use user_id argument.
  3. Import the above resource to the Terraform state.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions