Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thevops opened this issue Mar 6, 2024 · 0 comments
Open

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

thevops opened this issue Mar 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@thevops
Copy link

thevops commented Mar 6, 2024

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.

@pranav-new-relic pranav-new-relic added the enhancement New feature or request label Mar 7, 2024
pranav-new-relic added a commit that referenced this issue Aug 20, 2024
chore(usermanagement): minor refactor in a bid to improve reusability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants