1. Packages
  2. New Relic
  3. API Docs
  4. cloud
  5. AwsLinkAccount
New Relic v5.25.2 published on Friday, Jun 7, 2024 by Pulumi

newrelic.cloud.AwsLinkAccount

Explore with Pulumi AI

newrelic logo
New Relic v5.25.2 published on Friday, Jun 7, 2024 by Pulumi

    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.

    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",
        name: "account name",
    });
    
    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",
        name="account name")
    
    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"),
    			Name:                 pulumi.String("account name"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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",
            Name = "account name",
        });
    
    });
    
    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")
                .name("account name")
                .build());
    
        }
    }
    
    resources:
      foo:
        type: newrelic:cloud:AwsLinkAccount
        properties:
          arn: arn:aws:service:region:account-id:resource-id
          metricCollectionMode: PUSH
          name: account name
    

    Create AwsLinkAccount Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AwsLinkAccount(name: string, args: AwsLinkAccountArgs, opts?: CustomResourceOptions);
    @overload
    def AwsLinkAccount(resource_name: str,
                       args: AwsLinkAccountArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def AwsLinkAccount(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       arn: Optional[str] = None,
                       account_id: Optional[str] = None,
                       metric_collection_mode: Optional[str] = None,
                       name: Optional[str] = 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.
    
    

    Parameters

    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.

    Example

    The following reference example uses placeholder values for all input properties.

    var awsLinkAccountResource = new NewRelic.Cloud.AwsLinkAccount("awsLinkAccountResource", new()
    {
        Arn = "string",
        AccountId = "string",
        MetricCollectionMode = "string",
        Name = "string",
    });
    
    example, err := cloud.NewAwsLinkAccount(ctx, "awsLinkAccountResource", &cloud.AwsLinkAccountArgs{
    	Arn:                  pulumi.String("string"),
    	AccountId:            pulumi.String("string"),
    	MetricCollectionMode: pulumi.String("string"),
    	Name:                 pulumi.String("string"),
    })
    
    var awsLinkAccountResource = new AwsLinkAccount("awsLinkAccountResource", AwsLinkAccountArgs.builder()
        .arn("string")
        .accountId("string")
        .metricCollectionMode("string")
        .name("string")
        .build());
    
    aws_link_account_resource = newrelic.cloud.AwsLinkAccount("awsLinkAccountResource",
        arn="string",
        account_id="string",
        metric_collection_mode="string",
        name="string")
    
    const awsLinkAccountResource = new newrelic.cloud.AwsLinkAccount("awsLinkAccountResource", {
        arn: "string",
        accountId: "string",
        metricCollectionMode: "string",
        name: "string",
    });
    
    type: newrelic:cloud:AwsLinkAccount
    properties:
        accountId: string
        arn: string
        metricCollectionMode: string
        name: string
    

    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 string
    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 name of the linked account.
    Arn string
    The Amazon Resource Name (ARN) of the IAM role.
    AccountId string
    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 name of the linked account.
    arn String
    The Amazon Resource Name (ARN) of the IAM role.
    accountId String
    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 name of the linked account.
    arn string
    The Amazon Resource Name (ARN) of the IAM role.
    accountId string
    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 name of the linked account.
    arn str
    The Amazon Resource Name (ARN) of the IAM role.
    account_id str
    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 name of the linked account.
    arn String
    The Amazon Resource Name (ARN) of the IAM role.
    accountId String
    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 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[str] = 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 string
    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 name of the linked account.
    AccountId string
    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 name of the linked account.
    accountId String
    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 name of the linked account.
    accountId string
    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 name of the linked account.
    account_id str
    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 name of the linked account.
    accountId String
    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 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>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    New Relic pulumi/pulumi-newrelic
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the newrelic Terraform Provider.
    newrelic logo
    New Relic v5.25.2 published on Friday, Jun 7, 2024 by Pulumi