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.
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",
name: "account name",
});
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",
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.NewGcpLinkAccount(ctx, "foo", &cloud.GcpLinkAccountArgs{
AccountId: pulumi.String("account id of newrelic account"),
ProjectId: pulumi.String("id of the Project"),
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.GcpLinkAccount("foo", new()
{
AccountId = "account id of newrelic account",
ProjectId = "id of the Project",
Name = "account name",
});
});
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")
.name("account name")
.build());
}
}
resources:
foo:
type: newrelic:cloud:GcpLinkAccount
properties:
accountId: account id of newrelic account
projectId: id of the Project
name: account name
Create GcpLinkAccount Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new GcpLinkAccount(name: string, args: GcpLinkAccountArgs, opts?: CustomResourceOptions);
@overload
def GcpLinkAccount(resource_name: str,
args: GcpLinkAccountArgs,
opts: Optional[ResourceOptions] = None)
@overload
def GcpLinkAccount(resource_name: str,
opts: Optional[ResourceOptions] = None,
project_id: Optional[str] = None,
account_id: Optional[str] = None,
name: Optional[str] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var gcpLinkAccountResource = new NewRelic.Cloud.GcpLinkAccount("gcpLinkAccountResource", new()
{
ProjectId = "string",
AccountId = "string",
Name = "string",
});
example, err := cloud.NewGcpLinkAccount(ctx, "gcpLinkAccountResource", &cloud.GcpLinkAccountArgs{
ProjectId: pulumi.String("string"),
AccountId: pulumi.String("string"),
Name: pulumi.String("string"),
})
var gcpLinkAccountResource = new GcpLinkAccount("gcpLinkAccountResource", GcpLinkAccountArgs.builder()
.projectId("string")
.accountId("string")
.name("string")
.build());
gcp_link_account_resource = newrelic.cloud.GcpLinkAccount("gcpLinkAccountResource",
project_id="string",
account_id="string",
name="string")
const gcpLinkAccountResource = new newrelic.cloud.GcpLinkAccount("gcpLinkAccountResource", {
projectId: "string",
accountId: "string",
name: "string",
});
type: newrelic:cloud:GcpLinkAccount
properties:
accountId: string
name: string
projectId: string
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:
- project_
id str - Project ID of the GCP account.
- account_
id str - Account ID of the New Relic account.
- name str
- name of the linked account
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[str] = 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.
- account_
id str - Account ID of the New Relic account.
- name str
- name of the linked account
- project_
id str - 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>
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.