newrelic logo
New Relic v5.12.0, May 30 23

newrelic.cloud.GcpLinkAccount

Explore with Pulumi AI

Use this resource to link a GCP account to New Relic.

Prerequisite

To start receiving Google Cloud Platform (GCP) data with New Relic GCP integrations, connect your Google project to New Relic infrastructure monitoring. If you don’t have one already, create a New Relic account. It’s free, forever.

Setup is required in GCP for this resource to work properly. The New Relic GCP integration can be done by creating a user account or a service account.

A user with Project IAM Admin role is needed to add the service account ID as a member in your GCP project.

In the GCP project IAM & admin, the service account must have the Project Viewer role and the Service Usage Consumer role or, alternatively, a custom role.

Follow the steps outlined here to set up the integration.

Example Usage

You can also use the full example, including the GCP 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.GcpLinkAccount("foo", new()
    {
        AccountId = "account id of newrelic account",
        ProjectId = "id of the Project",
    });

});
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.NewGcpLinkAccount(ctx, "foo", &cloud.GcpLinkAccountArgs{
			AccountId: pulumi.Int("account id of newrelic account"),
			ProjectId: pulumi.String("id of the Project"),
		})
		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.GcpLinkAccount;
import com.pulumi.newrelic.cloud.GcpLinkAccountArgs;
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 GcpLinkAccount("foo", GcpLinkAccountArgs.builder()        
            .accountId("account id of newrelic account")
            .projectId("id of the Project")
            .build());

    }
}
import pulumi
import pulumi_newrelic as newrelic

foo = newrelic.cloud.GcpLinkAccount("foo",
    account_id="account id of newrelic account",
    project_id="id of the Project")
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";

const foo = new newrelic.cloud.GcpLinkAccount("foo", {
    accountId: "account id of newrelic account",
    projectId: "id of the Project",
});
resources:
  foo:
    type: newrelic:cloud:GcpLinkAccount
    properties:
      accountId: account id of newrelic account
      projectId: id of the Project

Create GcpLinkAccount Resource

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

name string
The unique name of the resource.
args GcpLinkAccountArgs
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 GcpLinkAccountArgs
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 GcpLinkAccountArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args GcpLinkAccountArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args GcpLinkAccountArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

GcpLinkAccount 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 GcpLinkAccount resource accepts the following input properties:

ProjectId string

Project ID of the GCP account.

AccountId int

Account ID of the New Relic account.

Name string

The name of the GCP account in New Relic.

ProjectId string

Project ID of the GCP account.

AccountId int

Account ID of the New Relic account.

Name string

The name of the GCP account in New Relic.

projectId String

Project ID of the GCP account.

accountId Integer

Account ID of the New Relic account.

name String

The name of the GCP account in New Relic.

projectId string

Project ID of the GCP account.

accountId number

Account ID of the New Relic account.

name string

The name of the GCP account in New Relic.

project_id str

Project ID of the GCP account.

account_id int

Account ID of the New Relic account.

name str

The name of the GCP account in New Relic.

projectId String

Project ID of the GCP account.

accountId Number

Account ID of the New Relic account.

name String

The name of the GCP account in New Relic.

Outputs

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

Get an existing GcpLinkAccount 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?: GcpLinkAccountState, opts?: CustomResourceOptions): GcpLinkAccount
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[int] = None,
        name: Optional[str] = None,
        project_id: Optional[str] = None) -> GcpLinkAccount
func GetGcpLinkAccount(ctx *Context, name string, id IDInput, state *GcpLinkAccountState, opts ...ResourceOption) (*GcpLinkAccount, error)
public static GcpLinkAccount Get(string name, Input<string> id, GcpLinkAccountState? state, CustomResourceOptions? opts = null)
public static GcpLinkAccount get(String name, Output<String> id, GcpLinkAccountState 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

Account ID of the New Relic account.

Name string

The name of the GCP account in New Relic.

ProjectId string

Project ID of the GCP account.

AccountId int

Account ID of the New Relic account.

Name string

The name of the GCP account in New Relic.

ProjectId string

Project ID of the GCP account.

accountId Integer

Account ID of the New Relic account.

name String

The name of the GCP account in New Relic.

projectId String

Project ID of the GCP account.

accountId number

Account ID of the New Relic account.

name string

The name of the GCP account in New Relic.

projectId string

Project ID of the GCP account.

account_id int

Account ID of the New Relic account.

name str

The name of the GCP account in New Relic.

project_id str

Project ID of the GCP account.

accountId Number

Account ID of the New Relic account.

name String

The name of the GCP account in New Relic.

projectId String

Project ID of the GCP account.

Import

Linked GCP accounts can be imported using id, you can find the id of an existing GCP linked accounts in GCP dashboard under Infrastructure in Newrelic Console. bash

 $ pulumi import newrelic:cloud/gcpLinkAccount:GcpLinkAccount newrelic_cloud_gcp_link_account.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.