terraform-provider-newrelic icon indicating copy to clipboard operation
terraform-provider-newrelic copied to clipboard

`newrelic_api_access_key` data source

Open Tensho opened this issue 2 years ago • 1 comments

Feature Description

The newrelic_account_management resource creates a brand new account with 2 prepopulated default API keys with names:

  1. License Key for <Account name>
  2. Browser Key for <Account name>

However, there is no Terraform data source to retrieve them programmatically in another place.

It would be nice to have newrelic_api_access_key data source counterpart to the resource.

data "newrelic_api_access_key" "default" {
  account_id  = 1234567
  key_type    = "INGEST"
  ingest_type = "LICENSE"
  name        = "License Key for <Account name>"
}

# Pass key as env var to k8s deployment
env {
  name  = "NEW_RELIC_LICENSE_KEY"
  value = data.newrelic_api_access_key.default.key
}

Additional context

NerdGraph API - Manage API keys - Query keys

Tensho avatar Jul 14 '23 21:07 Tensho