New Relic: Installation & Configuration
The Pulumi New Relic provider uses the New Relic SDK to manage and provision resources.
Installation
The New Relic provider is available as a package in all Pulumi languages:
- JavaScript/TypeScript:
@pulumi/newrelic
- Python:
pulumi-newrelic
- Go:
github.com/pulumi/pulumi-newrelic/sdk/v4/go/newrelic
- .NET:
Pulumi.Newrelic
- Java:
com.pulumi/newrelic
Configuring Credentials
Pulumi relies on the New Relic SDK to authenticate requests from your computer to New Relic. Your credentials are never sent to pulumi.com. The Pulumi New Relic Provider needs to be configured with New Relic credentials before it can be used to create resources.
You can find information in the New Relic docs regarding how to create the specific keys. Once the credentials are obtained, there are two ways to communicate your authorization tokens to Pulumi:
Set the environment variables
NEW_RELIC_ACCOUNT_ID
,NEW_RELIC_API_KEY
andNEW_RELIC_ADMIN_API_KEY
:$ export NEW_RELIC_ACCOUNT_ID=XXXXXXXXXXXXXX $ export NEW_RELIC_API_KEY=YYYYYYYYYYYYYY $ export NEW_RELIC_ADMIN_API_KEY=ZZZZZZZZZZZZ
Set them using configuration, if you prefer that they be stored alongside your Pulumi stack for easy multi-user access:
$ pulumi config set newrelic:accountId XXXXXXXXXXXXXX $ pulumi config set newrelic:apiKey YYYYYYYYYYYYYY --secret $ pulumi config set newrelic:adminApiKey ZZZZZZZZZZZZ --secret
Remember to pass --secret
when setting newrelic:apiKey
and newrelic:adminApiKey
so that it is properly encrypted. The complete list of
configuration parameters is in the New Relic provider README.