newrelic.cloud.AwsLinkAccount
Explore with Pulumi AI
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
You can also use the full example, including the AWS set up, found in our guides.
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var foo = new NewRelic.Cloud.AwsLinkAccount("foo", new()
{
Arn = "arn:aws:service:region:account-id:resource-id",
MetricCollectionMode = "PUSH",
});
});
package main
import (
"github.com/pulumi/pulumi-newrelic/sdk/v5/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 com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.cloud.AwsLinkAccount;
import com.pulumi.newrelic.cloud.AwsLinkAccountArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
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 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.
- 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 variableNEW_RELIC_ACCOUNT_ID
.- Metric
Collection stringMode How metrics will be collected. Use
PUSH
for a metric stream orPULL
to integrate with individual services.- Name string
The name of the linked account.
- Arn string
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 variableNEW_RELIC_ACCOUNT_ID
.- Metric
Collection stringMode How metrics will be collected. Use
PUSH
for a metric stream orPULL
to integrate with individual services.- Name string
The name of the linked account.
- arn String
The Amazon Resource Name (ARN) of the IAM role.
- account
Id 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 variableNEW_RELIC_ACCOUNT_ID
.- metric
Collection StringMode How metrics will be collected. Use
PUSH
for a metric stream orPULL
to integrate with individual services.- name String
The name of the linked account.
- arn string
The Amazon Resource Name (ARN) of the IAM role.
- account
Id 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 variableNEW_RELIC_ACCOUNT_ID
.- metric
Collection stringMode How metrics will be collected. Use
PUSH
for a metric stream orPULL
to integrate with individual services.- name string
The name of the linked account.
- 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 variableNEW_RELIC_ACCOUNT_ID
.- metric_
collection_ strmode How metrics will be collected. Use
PUSH
for a metric stream orPULL
to integrate with individual services.- name str
The name of the linked account.
- arn String
The Amazon Resource Name (ARN) of the IAM role.
- account
Id 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 variableNEW_RELIC_ACCOUNT_ID
.- metric
Collection StringMode How metrics will be collected. Use
PUSH
for a metric stream orPULL
to integrate with individual services.- name String
The name of the linked account.
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 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.
- 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 variableNEW_RELIC_ACCOUNT_ID
.- Arn string
The Amazon Resource Name (ARN) of the IAM role.
- Metric
Collection stringMode How metrics will be collected. Use
PUSH
for a metric stream orPULL
to integrate with individual services.- Name string
The name of the linked account.
- 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 variableNEW_RELIC_ACCOUNT_ID
.- Arn string
The Amazon Resource Name (ARN) of the IAM role.
- Metric
Collection stringMode How metrics will be collected. Use
PUSH
for a metric stream orPULL
to integrate with individual services.- Name string
The name of the linked account.
- account
Id 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 variableNEW_RELIC_ACCOUNT_ID
.- arn String
The Amazon Resource Name (ARN) of the IAM role.
- metric
Collection StringMode How metrics will be collected. Use
PUSH
for a metric stream orPULL
to integrate with individual services.- name String
The name of the linked account.
- account
Id 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 variableNEW_RELIC_ACCOUNT_ID
.- arn string
The Amazon Resource Name (ARN) of the IAM role.
- metric
Collection stringMode How metrics will be collected. Use
PUSH
for a metric stream orPULL
to integrate with individual services.- name string
The name of the linked account.
- 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 variableNEW_RELIC_ACCOUNT_ID
.- arn str
The Amazon Resource Name (ARN) of the IAM role.
- metric_
collection_ strmode How metrics will be collected. Use
PUSH
for a metric stream orPULL
to integrate with individual services.- name str
The name of the linked account.
- account
Id 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 variableNEW_RELIC_ACCOUNT_ID
.- arn String
The Amazon Resource Name (ARN) of the IAM role.
- metric
Collection StringMode How metrics will be collected. Use
PUSH
for a metric stream orPULL
to integrate with individual services.- name String
The name of the linked account.
Import
Linked AWS accounts can be imported using the id
, e.g. bash
$ pulumi import newrelic:cloud/awsLinkAccount:AwsLinkAccount foo <id>
Package Details
- Repository
- New Relic pulumi/pulumi-newrelic
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
newrelic
Terraform Provider.