New Relic

Pulumi Official
Package maintained by Pulumi
v4.15.0 published on Monday, May 16, 2022 by Pulumi

AwsLinkAccount

Use this resource to link an AWS account to New Relic.

Prerequisite

Setup is required in AWS for this resource to work properly. The New Relic AWS integration can be set up to pull metrics from AWS services or AWS can push metrics to New Relic using CloudWatch Metric Streams.

Using a metric stream to New Relic is the preferred way to integrate with AWS. Follow the steps outlined here to set up a metric stream.

To pull data from AWS instead, complete the steps outlined here.

Example Usage

using Pulumi;
using NewRelic = Pulumi.NewRelic;

class MyStack : Stack
{
    public MyStack()
    {
        var foo = new NewRelic.Cloud.AwsLinkAccount("foo", new NewRelic.Cloud.AwsLinkAccountArgs
        {
            Arn = "arn:aws:service:region:account-id:resource-id",
            MetricCollectionMode = "PUSH",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-newrelic/sdk/v4/go/newrelic/cloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloud.NewAwsLinkAccount(ctx, "foo", &cloud.AwsLinkAccountArgs{
			Arn:                  pulumi.String("arn:aws:service:region:account-id:resource-id"),
			MetricCollectionMode: pulumi.String("PUSH"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var foo = new AwsLinkAccount("foo", AwsLinkAccountArgs.builder()        
            .arn("arn:aws:service:region:account-id:resource-id")
            .metricCollectionMode("PUSH")
            .build());

        }
}
import pulumi
import pulumi_newrelic as newrelic

foo = newrelic.cloud.AwsLinkAccount("foo",
    arn="arn:aws:service:region:account-id:resource-id",
    metric_collection_mode="PUSH")
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";

const foo = new newrelic.cloud.AwsLinkAccount("foo", {
    arn: "arn:aws:service:region:account-id:resource-id",
    metricCollectionMode: "PUSH",
});
resources:
  foo:
    type: newrelic:cloud:AwsLinkAccount
    properties:
      arn: arn:aws:service:region:account-id:resource-id
      metricCollectionMode: PUSH

Create a AwsLinkAccount Resource

new AwsLinkAccount(name: string, args: AwsLinkAccountArgs, opts?: CustomResourceOptions);
@overload
def AwsLinkAccount(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   account_id: Optional[int] = None,
                   arn: Optional[str] = None,
                   metric_collection_mode: Optional[str] = None,
                   name: Optional[str] = None)
@overload
def AwsLinkAccount(resource_name: str,
                   args: AwsLinkAccountArgs,
                   opts: Optional[ResourceOptions] = None)
func NewAwsLinkAccount(ctx *Context, name string, args AwsLinkAccountArgs, opts ...ResourceOption) (*AwsLinkAccount, error)
public AwsLinkAccount(string name, AwsLinkAccountArgs args, CustomResourceOptions? opts = null)
public AwsLinkAccount(String name, AwsLinkAccountArgs args)
public AwsLinkAccount(String name, AwsLinkAccountArgs args, CustomResourceOptions options)
type: newrelic:cloud:AwsLinkAccount
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args AwsLinkAccountArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args AwsLinkAccountArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args AwsLinkAccountArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AwsLinkAccountArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args AwsLinkAccountArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

AwsLinkAccount Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The AwsLinkAccount resource accepts the following input properties:

Arn string

The Amazon Resource Name (ARN) of the IAM role.

AccountId int

The New Relic account ID to operate on. This allows the user to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

MetricCollectionMode string

How metrics will be collected. Use PUSH for a metric stream or PULL to integrate with individual services.

Name string
  • The linked account name
Arn string

The Amazon Resource Name (ARN) of the IAM role.

AccountId int

The New Relic account ID to operate on. This allows the user to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

MetricCollectionMode string

How metrics will be collected. Use PUSH for a metric stream or PULL to integrate with individual services.

Name string
  • The linked account name
arn String

The Amazon Resource Name (ARN) of the IAM role.

accountId Integer

The New Relic account ID to operate on. This allows the user to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

metricCollectionMode String

How metrics will be collected. Use PUSH for a metric stream or PULL to integrate with individual services.

name String
  • The linked account name
arn string

The Amazon Resource Name (ARN) of the IAM role.

accountId number

The New Relic account ID to operate on. This allows the user to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

metricCollectionMode string

How metrics will be collected. Use PUSH for a metric stream or PULL to integrate with individual services.

name string
  • The linked account name
arn str

The Amazon Resource Name (ARN) of the IAM role.

account_id int

The New Relic account ID to operate on. This allows the user to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

metric_collection_mode str

How metrics will be collected. Use PUSH for a metric stream or PULL to integrate with individual services.

name str
  • The linked account name
arn String

The Amazon Resource Name (ARN) of the IAM role.

accountId Number

The New Relic account ID to operate on. This allows the user to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

metricCollectionMode String

How metrics will be collected. Use PUSH for a metric stream or PULL to integrate with individual services.

name String
  • The linked account name

Outputs

All input properties are implicitly available as output properties. Additionally, the AwsLinkAccount resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up an Existing AwsLinkAccount Resource

Get an existing AwsLinkAccount resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: AwsLinkAccountState, opts?: CustomResourceOptions): AwsLinkAccount
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[int] = None,
        arn: Optional[str] = None,
        metric_collection_mode: Optional[str] = None,
        name: Optional[str] = None) -> AwsLinkAccount
func GetAwsLinkAccount(ctx *Context, name string, id IDInput, state *AwsLinkAccountState, opts ...ResourceOption) (*AwsLinkAccount, error)
public static AwsLinkAccount Get(string name, Input<string> id, AwsLinkAccountState? state, CustomResourceOptions? opts = null)
public static AwsLinkAccount get(String name, Output<String> id, AwsLinkAccountState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AccountId int

The New Relic account ID to operate on. This allows the user to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

Arn string

The Amazon Resource Name (ARN) of the IAM role.

MetricCollectionMode string

How metrics will be collected. Use PUSH for a metric stream or PULL to integrate with individual services.

Name string
  • The linked account name
AccountId int

The New Relic account ID to operate on. This allows the user to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

Arn string

The Amazon Resource Name (ARN) of the IAM role.

MetricCollectionMode string

How metrics will be collected. Use PUSH for a metric stream or PULL to integrate with individual services.

Name string
  • The linked account name
accountId Integer

The New Relic account ID to operate on. This allows the user to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

arn String

The Amazon Resource Name (ARN) of the IAM role.

metricCollectionMode String

How metrics will be collected. Use PUSH for a metric stream or PULL to integrate with individual services.

name String
  • The linked account name
accountId number

The New Relic account ID to operate on. This allows the user to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

arn string

The Amazon Resource Name (ARN) of the IAM role.

metricCollectionMode string

How metrics will be collected. Use PUSH for a metric stream or PULL to integrate with individual services.

name string
  • The linked account name
account_id int

The New Relic account ID to operate on. This allows the user to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

arn str

The Amazon Resource Name (ARN) of the IAM role.

metric_collection_mode str

How metrics will be collected. Use PUSH for a metric stream or PULL to integrate with individual services.

name str
  • The linked account name
accountId Number

The New Relic account ID to operate on. This allows the user to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

arn String

The Amazon Resource Name (ARN) of the IAM role.

metricCollectionMode String

How metrics will be collected. Use PUSH for a metric stream or PULL to integrate with individual services.

name String
  • The linked account name

Import

Linked AWS accounts can be imported using the id, e.g. bash

 $ pulumi import newrelic:cloud/awsLinkAccount:AwsLinkAccount foo <id>

Package Details

Repository
https://github.com/pulumi/pulumi-newrelic
License
Apache-2.0
Notes

This Pulumi package is based on the newrelic Terraform Provider.