1. Packages
  2. Newrelic Provider
  3. API Docs
  4. cloud
  5. AwsGovcloudLinkAccount
New Relic v5.44.0 published on Saturday, Mar 29, 2025 by Pulumi

newrelic.cloud.AwsGovcloudLinkAccount

Explore with Pulumi AI

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

Prerequisite

To link an AWS GovCloud account to New Relic, you need an AWS GovCloud account. AWS GovCloud is designed to address the specific regulatory needs of United States federal, state, and local agencies, educational institutions, and their supporting ecosystem. It is an isolated AWS region designed to host sensitive data and regulated workloads in the cloud, helping customers support their US government compliance requirements.

To pull data from AWS GovCloud, follow the steps outlined here.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";

const foo = new newrelic.cloud.AwsGovcloudLinkAccount("foo", {
    accountId: "1234567",
    name: "My New Relic - AWS GovCloud Linked Account",
    metricCollectionMode: "PUSH",
    arn: "arn:aws:service:region:account-id:resource-id",
});
Copy
import pulumi
import pulumi_newrelic as newrelic

foo = newrelic.cloud.AwsGovcloudLinkAccount("foo",
    account_id="1234567",
    name="My New Relic - AWS GovCloud Linked Account",
    metric_collection_mode="PUSH",
    arn="arn:aws:service:region:account-id:resource-id")
Copy
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.NewAwsGovcloudLinkAccount(ctx, "foo", &cloud.AwsGovcloudLinkAccountArgs{
			AccountId:            pulumi.String("1234567"),
			Name:                 pulumi.String("My New Relic - AWS GovCloud Linked Account"),
			MetricCollectionMode: pulumi.String("PUSH"),
			Arn:                  pulumi.String("arn:aws:service:region:account-id:resource-id"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;

return await Deployment.RunAsync(() => 
{
    var foo = new NewRelic.Cloud.AwsGovcloudLinkAccount("foo", new()
    {
        AccountId = "1234567",
        Name = "My New Relic - AWS GovCloud Linked Account",
        MetricCollectionMode = "PUSH",
        Arn = "arn:aws:service:region:account-id:resource-id",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.cloud.AwsGovcloudLinkAccount;
import com.pulumi.newrelic.cloud.AwsGovcloudLinkAccountArgs;
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 AwsGovcloudLinkAccount("foo", AwsGovcloudLinkAccountArgs.builder()
            .accountId(1234567)
            .name("My New Relic - AWS GovCloud Linked Account")
            .metricCollectionMode("PUSH")
            .arn("arn:aws:service:region:account-id:resource-id")
            .build());

    }
}
Copy
resources:
  foo:
    type: newrelic:cloud:AwsGovcloudLinkAccount
    properties:
      accountId: 1.234567e+06
      name: My New Relic - AWS GovCloud Linked Account
      metricCollectionMode: PUSH
      arn: arn:aws:service:region:account-id:resource-id
Copy

Create AwsGovcloudLinkAccount Resource

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

Constructor syntax

new AwsGovcloudLinkAccount(name: string, args: AwsGovcloudLinkAccountArgs, opts?: CustomResourceOptions);
@overload
def AwsGovcloudLinkAccount(resource_name: str,
                           args: AwsGovcloudLinkAccountArgs,
                           opts: Optional[ResourceOptions] = None)

@overload
def AwsGovcloudLinkAccount(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 NewAwsGovcloudLinkAccount(ctx *Context, name string, args AwsGovcloudLinkAccountArgs, opts ...ResourceOption) (*AwsGovcloudLinkAccount, error)
public AwsGovcloudLinkAccount(string name, AwsGovcloudLinkAccountArgs args, CustomResourceOptions? opts = null)
public AwsGovcloudLinkAccount(String name, AwsGovcloudLinkAccountArgs args)
public AwsGovcloudLinkAccount(String name, AwsGovcloudLinkAccountArgs args, CustomResourceOptions options)
type: newrelic:cloud:AwsGovcloudLinkAccount
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

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

Constructor example

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

var awsGovcloudLinkAccountResource = new NewRelic.Cloud.AwsGovcloudLinkAccount("awsGovcloudLinkAccountResource", new()
{
    Arn = "string",
    AccountId = "string",
    MetricCollectionMode = "string",
    Name = "string",
});
Copy
example, err := cloud.NewAwsGovcloudLinkAccount(ctx, "awsGovcloudLinkAccountResource", &cloud.AwsGovcloudLinkAccountArgs{
	Arn:                  pulumi.String("string"),
	AccountId:            pulumi.String("string"),
	MetricCollectionMode: pulumi.String("string"),
	Name:                 pulumi.String("string"),
})
Copy
var awsGovcloudLinkAccountResource = new AwsGovcloudLinkAccount("awsGovcloudLinkAccountResource", AwsGovcloudLinkAccountArgs.builder()
    .arn("string")
    .accountId("string")
    .metricCollectionMode("string")
    .name("string")
    .build());
Copy
aws_govcloud_link_account_resource = newrelic.cloud.AwsGovcloudLinkAccount("awsGovcloudLinkAccountResource",
    arn="string",
    account_id="string",
    metric_collection_mode="string",
    name="string")
Copy
const awsGovcloudLinkAccountResource = new newrelic.cloud.AwsGovcloudLinkAccount("awsGovcloudLinkAccountResource", {
    arn: "string",
    accountId: "string",
    metricCollectionMode: "string",
    name: "string",
});
Copy
type: newrelic:cloud:AwsGovcloudLinkAccount
properties:
    accountId: string
    arn: string
    metricCollectionMode: string
    name: string
Copy

AwsGovcloudLinkAccount Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The AwsGovcloudLinkAccount resource accepts the following input properties:

Arn This property is required. string

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

NOTE: Altering the account_id (or) metric_collection_mode of an already applied newrelic.cloud.AwsGovcloudLinkAccount resource shall trigger a recreation of the resource, instead of an update.

AccountId Changes to this property will trigger replacement. 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, if not specified in the configuration.
MetricCollectionMode Changes to this property will trigger replacement. string
The mode by which metric data is to be collected from the linked AWS GovCloud account. Defaults to PULL, if not specified in the configuration.

  • Use PUSH for Metric Streams and PULL for API Polling based metric collection respectively.
Name string
The name/identifier of the AWS GovCloud - New Relic 'linked' account.
Arn This property is required. string

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

NOTE: Altering the account_id (or) metric_collection_mode of an already applied newrelic.cloud.AwsGovcloudLinkAccount resource shall trigger a recreation of the resource, instead of an update.

AccountId Changes to this property will trigger replacement. 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, if not specified in the configuration.
MetricCollectionMode Changes to this property will trigger replacement. string
The mode by which metric data is to be collected from the linked AWS GovCloud account. Defaults to PULL, if not specified in the configuration.

  • Use PUSH for Metric Streams and PULL for API Polling based metric collection respectively.
Name string
The name/identifier of the AWS GovCloud - New Relic 'linked' account.
arn This property is required. String

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

NOTE: Altering the account_id (or) metric_collection_mode of an already applied newrelic.cloud.AwsGovcloudLinkAccount resource shall trigger a recreation of the resource, instead of an update.

accountId Changes to this property will trigger replacement. 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, if not specified in the configuration.
metricCollectionMode Changes to this property will trigger replacement. String
The mode by which metric data is to be collected from the linked AWS GovCloud account. Defaults to PULL, if not specified in the configuration.

  • Use PUSH for Metric Streams and PULL for API Polling based metric collection respectively.
name String
The name/identifier of the AWS GovCloud - New Relic 'linked' account.
arn This property is required. string

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

NOTE: Altering the account_id (or) metric_collection_mode of an already applied newrelic.cloud.AwsGovcloudLinkAccount resource shall trigger a recreation of the resource, instead of an update.

accountId Changes to this property will trigger replacement. 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, if not specified in the configuration.
metricCollectionMode Changes to this property will trigger replacement. string
The mode by which metric data is to be collected from the linked AWS GovCloud account. Defaults to PULL, if not specified in the configuration.

  • Use PUSH for Metric Streams and PULL for API Polling based metric collection respectively.
name string
The name/identifier of the AWS GovCloud - New Relic 'linked' account.
arn This property is required. str

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

NOTE: Altering the account_id (or) metric_collection_mode of an already applied newrelic.cloud.AwsGovcloudLinkAccount resource shall trigger a recreation of the resource, instead of an update.

account_id Changes to this property will trigger replacement. 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, if not specified in the configuration.
metric_collection_mode Changes to this property will trigger replacement. str
The mode by which metric data is to be collected from the linked AWS GovCloud account. Defaults to PULL, if not specified in the configuration.

  • Use PUSH for Metric Streams and PULL for API Polling based metric collection respectively.
name str
The name/identifier of the AWS GovCloud - New Relic 'linked' account.
arn This property is required. String

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

NOTE: Altering the account_id (or) metric_collection_mode of an already applied newrelic.cloud.AwsGovcloudLinkAccount resource shall trigger a recreation of the resource, instead of an update.

accountId Changes to this property will trigger replacement. 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, if not specified in the configuration.
metricCollectionMode Changes to this property will trigger replacement. String
The mode by which metric data is to be collected from the linked AWS GovCloud account. Defaults to PULL, if not specified in the configuration.

  • Use PUSH for Metric Streams and PULL for API Polling based metric collection respectively.
name String
The name/identifier of the AWS GovCloud - New Relic 'linked' account.

Outputs

All input properties are implicitly available as output properties. Additionally, the AwsGovcloudLinkAccount 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 AwsGovcloudLinkAccount Resource

Get an existing AwsGovcloudLinkAccount 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?: AwsGovcloudLinkAccountState, opts?: CustomResourceOptions): AwsGovcloudLinkAccount
@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) -> AwsGovcloudLinkAccount
func GetAwsGovcloudLinkAccount(ctx *Context, name string, id IDInput, state *AwsGovcloudLinkAccountState, opts ...ResourceOption) (*AwsGovcloudLinkAccount, error)
public static AwsGovcloudLinkAccount Get(string name, Input<string> id, AwsGovcloudLinkAccountState? state, CustomResourceOptions? opts = null)
public static AwsGovcloudLinkAccount get(String name, Output<String> id, AwsGovcloudLinkAccountState state, CustomResourceOptions options)
resources:  _:    type: newrelic:cloud:AwsGovcloudLinkAccount    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. 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, if not specified in the configuration.
Arn string

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

NOTE: Altering the account_id (or) metric_collection_mode of an already applied newrelic.cloud.AwsGovcloudLinkAccount resource shall trigger a recreation of the resource, instead of an update.

MetricCollectionMode Changes to this property will trigger replacement. string
The mode by which metric data is to be collected from the linked AWS GovCloud account. Defaults to PULL, if not specified in the configuration.

  • Use PUSH for Metric Streams and PULL for API Polling based metric collection respectively.
Name string
The name/identifier of the AWS GovCloud - New Relic 'linked' account.
AccountId Changes to this property will trigger replacement. 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, if not specified in the configuration.
Arn string

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

NOTE: Altering the account_id (or) metric_collection_mode of an already applied newrelic.cloud.AwsGovcloudLinkAccount resource shall trigger a recreation of the resource, instead of an update.

MetricCollectionMode Changes to this property will trigger replacement. string
The mode by which metric data is to be collected from the linked AWS GovCloud account. Defaults to PULL, if not specified in the configuration.

  • Use PUSH for Metric Streams and PULL for API Polling based metric collection respectively.
Name string
The name/identifier of the AWS GovCloud - New Relic 'linked' account.
accountId Changes to this property will trigger replacement. 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, if not specified in the configuration.
arn String

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

NOTE: Altering the account_id (or) metric_collection_mode of an already applied newrelic.cloud.AwsGovcloudLinkAccount resource shall trigger a recreation of the resource, instead of an update.

metricCollectionMode Changes to this property will trigger replacement. String
The mode by which metric data is to be collected from the linked AWS GovCloud account. Defaults to PULL, if not specified in the configuration.

  • Use PUSH for Metric Streams and PULL for API Polling based metric collection respectively.
name String
The name/identifier of the AWS GovCloud - New Relic 'linked' account.
accountId Changes to this property will trigger replacement. 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, if not specified in the configuration.
arn string

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

NOTE: Altering the account_id (or) metric_collection_mode of an already applied newrelic.cloud.AwsGovcloudLinkAccount resource shall trigger a recreation of the resource, instead of an update.

metricCollectionMode Changes to this property will trigger replacement. string
The mode by which metric data is to be collected from the linked AWS GovCloud account. Defaults to PULL, if not specified in the configuration.

  • Use PUSH for Metric Streams and PULL for API Polling based metric collection respectively.
name string
The name/identifier of the AWS GovCloud - New Relic 'linked' account.
account_id Changes to this property will trigger replacement. 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, if not specified in the configuration.
arn str

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

NOTE: Altering the account_id (or) metric_collection_mode of an already applied newrelic.cloud.AwsGovcloudLinkAccount resource shall trigger a recreation of the resource, instead of an update.

metric_collection_mode Changes to this property will trigger replacement. str
The mode by which metric data is to be collected from the linked AWS GovCloud account. Defaults to PULL, if not specified in the configuration.

  • Use PUSH for Metric Streams and PULL for API Polling based metric collection respectively.
name str
The name/identifier of the AWS GovCloud - New Relic 'linked' account.
accountId Changes to this property will trigger replacement. 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, if not specified in the configuration.
arn String

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

NOTE: Altering the account_id (or) metric_collection_mode of an already applied newrelic.cloud.AwsGovcloudLinkAccount resource shall trigger a recreation of the resource, instead of an update.

metricCollectionMode Changes to this property will trigger replacement. String
The mode by which metric data is to be collected from the linked AWS GovCloud account. Defaults to PULL, if not specified in the configuration.

  • Use PUSH for Metric Streams and PULL for API Polling based metric collection respectively.
name String
The name/identifier of the AWS GovCloud - New Relic 'linked' account.

Import

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

bash

$ pulumi import newrelic:cloud/awsGovcloudLinkAccount:AwsGovcloudLinkAccount foo <id>
Copy

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.