1. Registry
  2. Packages
  3. Newrelic Provider
  4. API Docs
  5. getCloudAccount
Viewing docs for New Relic v5.76.5
published on Friday, Sep 11, 2026 by Pulumi
newrelic logo newrelic logo
Viewing docs for New Relic v5.76.5
published on Friday, Sep 11, 2026 by Pulumi

    Use this data source to get information about a specific cloud account linked to New Relic. Accounts can be located by a combination of New Relic Account ID, name and cloud provider (aws, gcp, azure, etc). Name and cloud provider are required attributes. If no accountId is specified on the resource the provider level accountId will be used.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as newrelic from "@pulumi/newrelic";
    
    const account = newrelic.getCloudAccount({
        accountId: "12345",
        cloudProvider: "aws",
        name: "my aws account",
    });
    
    import pulumi
    import pulumi_newrelic as newrelic
    
    account = newrelic.get_cloud_account(account_id="12345",
        cloud_provider="aws",
        name="my aws account")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := newrelic.GetCloudAccount(ctx, &newrelic.GetCloudAccountArgs{
    			AccountId:     pulumi.StringRef("12345"),
    			CloudProvider: "aws",
    			Name:          "my aws account",
    		}, nil)
    		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 account = NewRelic.GetCloudAccount.Invoke(new()
        {
            AccountId = "12345",
            CloudProvider = "aws",
            Name = "my aws account",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.newrelic.NewrelicFunctions;
    import com.pulumi.newrelic.inputs.GetCloudAccountArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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) {
            final var account = NewrelicFunctions.getCloudAccount(GetCloudAccountArgs.builder()
                .accountId("12345")
                .cloudProvider("aws")
                .name("my aws account")
                .build());
    
        }
    }
    
    variables:
      account:
        fn::invoke:
          function: newrelic:getCloudAccount
          arguments:
            accountId: 12345
            cloudProvider: aws
            name: my aws account
    
    pulumi {
      required_providers {
        newrelic = {
          source = "pulumi/newrelic"
        }
      }
    }
    
    data "newrelic_getcloudaccount" "account" {
      account_id     = 12345
      cloud_provider = "aws"
      name           = "my aws account"
    }
    

    GCP Dimensional Metrics account lookup

    To look up a GCP account linked for GCP Dimensional Metrics (keyless / Workload Identity Federation), set cloudProvider = "gcp" and isDimensionalMetrics = true. This flag tells the data source to match only Dimensional Metrics linked accounts, distinguishing them from legacy GCP integration accounts of the same name.

    import * as pulumi from "@pulumi/pulumi";
    import * as newrelic from "@pulumi/newrelic";
    
    const gcpDmAccount = newrelic.getCloudAccount({
        accountId: "12345",
        cloudProvider: "gcp",
        name: "my gcp dimensional metrics account",
        isDimensionalMetrics: true,
    });
    
    import pulumi
    import pulumi_newrelic as newrelic
    
    gcp_dm_account = newrelic.get_cloud_account(account_id="12345",
        cloud_provider="gcp",
        name="my gcp dimensional metrics account",
        is_dimensional_metrics=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := newrelic.GetCloudAccount(ctx, &newrelic.GetCloudAccountArgs{
    			AccountId:            pulumi.StringRef("12345"),
    			CloudProvider:        "gcp",
    			Name:                 "my gcp dimensional metrics account",
    			IsDimensionalMetrics: pulumi.BoolRef(true),
    		}, nil)
    		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 gcpDmAccount = NewRelic.GetCloudAccount.Invoke(new()
        {
            AccountId = "12345",
            CloudProvider = "gcp",
            Name = "my gcp dimensional metrics account",
            IsDimensionalMetrics = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.newrelic.NewrelicFunctions;
    import com.pulumi.newrelic.inputs.GetCloudAccountArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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) {
            final var gcpDmAccount = NewrelicFunctions.getCloudAccount(GetCloudAccountArgs.builder()
                .accountId("12345")
                .cloudProvider("gcp")
                .name("my gcp dimensional metrics account")
                .isDimensionalMetrics(true)
                .build());
    
        }
    }
    
    variables:
      gcpDmAccount:
        fn::invoke:
          function: newrelic:getCloudAccount
          arguments:
            accountId: 12345
            cloudProvider: gcp
            name: my gcp dimensional metrics account
            isDimensionalMetrics: true
    
    pulumi {
      required_providers {
        newrelic = {
          source = "pulumi/newrelic"
        }
      }
    }
    
    data "newrelic_getcloudaccount" "gcpDmAccount" {
      account_id             = 12345
      cloud_provider         = "gcp"
      name                   = "my gcp dimensional metrics account"
      is_dimensional_metrics = true
    }
    

    Using getCloudAccount

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getCloudAccount(args: GetCloudAccountArgs, opts?: InvokeOptions): Promise<GetCloudAccountResult>
    function getCloudAccountOutput(args: GetCloudAccountOutputArgs, opts?: InvokeOutputOptions): Output<GetCloudAccountResult>
    def get_cloud_account(account_id: Optional[str] = None,
                          cloud_provider: Optional[str] = None,
                          is_dimensional_metrics: Optional[bool] = None,
                          name: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetCloudAccountResult
    def get_cloud_account_output(account_id: pulumi.Input[Optional[str]] = None,
                          cloud_provider: pulumi.Input[Optional[str]] = None,
                          is_dimensional_metrics: pulumi.Input[Optional[bool]] = None,
                          name: pulumi.Input[Optional[str]] = None,
                          opts: Optional[InvokeOutputOptions] = None) -> Output[GetCloudAccountResult]
    func GetCloudAccount(ctx *Context, args *GetCloudAccountArgs, opts ...InvokeOption) (*GetCloudAccountResult, error)
    func GetCloudAccountOutput(ctx *Context, args *GetCloudAccountOutputArgs, opts ...InvokeOption) GetCloudAccountResultOutput

    > Note: This function is named GetCloudAccount in the Go SDK.

    public static class GetCloudAccount 
    {
        public static Task<GetCloudAccountResult> InvokeAsync(GetCloudAccountArgs args, InvokeOptions? opts = null)
        public static Output<GetCloudAccountResult> Invoke(GetCloudAccountInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetCloudAccountResult> Invoke(GetCloudAccountInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetCloudAccountResult> getCloudAccount(GetCloudAccountArgs args, InvokeOptions options)
    public static Output<GetCloudAccountResult> getCloudAccount(GetCloudAccountArgs args, InvokeOptions options)
    public static Output<GetCloudAccountResult> getCloudAccount(GetCloudAccountArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: newrelic:index/getCloudAccount:getCloudAccount
      arguments:
        # arguments dictionary
    data "newrelic_get_cloud_account" "name" {
        # arguments
    }

    The following arguments are supported:

    CloudProvider string
    The cloud provider of the account (aws, gcp, azure, etc)
    Name string
    The cloud account name in New Relic.
    AccountId string
    The account ID in New Relic.
    IsDimensionalMetrics bool
    Set to true to look up a GCP Dimensional Metrics (keyless / Workload Identity Federation) linked account, as opposed to a legacy GCP integration account of the same name. Can only be used when cloudProvider is "gcp". Defaults to false.
    CloudProvider string
    The cloud provider of the account (aws, gcp, azure, etc)
    Name string
    The cloud account name in New Relic.
    AccountId string
    The account ID in New Relic.
    IsDimensionalMetrics bool
    Set to true to look up a GCP Dimensional Metrics (keyless / Workload Identity Federation) linked account, as opposed to a legacy GCP integration account of the same name. Can only be used when cloudProvider is "gcp". Defaults to false.
    cloud_provider string
    The cloud provider of the account (aws, gcp, azure, etc)
    name string
    The cloud account name in New Relic.
    account_id string
    The account ID in New Relic.
    is_dimensional_metrics bool
    Set to true to look up a GCP Dimensional Metrics (keyless / Workload Identity Federation) linked account, as opposed to a legacy GCP integration account of the same name. Can only be used when cloudProvider is "gcp". Defaults to false.
    cloudProvider String
    The cloud provider of the account (aws, gcp, azure, etc)
    name String
    The cloud account name in New Relic.
    accountId String
    The account ID in New Relic.
    isDimensionalMetrics Boolean
    Set to true to look up a GCP Dimensional Metrics (keyless / Workload Identity Federation) linked account, as opposed to a legacy GCP integration account of the same name. Can only be used when cloudProvider is "gcp". Defaults to false.
    cloudProvider string
    The cloud provider of the account (aws, gcp, azure, etc)
    name string
    The cloud account name in New Relic.
    accountId string
    The account ID in New Relic.
    isDimensionalMetrics boolean
    Set to true to look up a GCP Dimensional Metrics (keyless / Workload Identity Federation) linked account, as opposed to a legacy GCP integration account of the same name. Can only be used when cloudProvider is "gcp". Defaults to false.
    cloud_provider str
    The cloud provider of the account (aws, gcp, azure, etc)
    name str
    The cloud account name in New Relic.
    account_id str
    The account ID in New Relic.
    is_dimensional_metrics bool
    Set to true to look up a GCP Dimensional Metrics (keyless / Workload Identity Federation) linked account, as opposed to a legacy GCP integration account of the same name. Can only be used when cloudProvider is "gcp". Defaults to false.
    cloudProvider String
    The cloud provider of the account (aws, gcp, azure, etc)
    name String
    The cloud account name in New Relic.
    accountId String
    The account ID in New Relic.
    isDimensionalMetrics Boolean
    Set to true to look up a GCP Dimensional Metrics (keyless / Workload Identity Federation) linked account, as opposed to a legacy GCP integration account of the same name. Can only be used when cloudProvider is "gcp". Defaults to false.

    getCloudAccount Result

    The following output properties are available:

    CloudProvider string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    AccountId string
    IsDimensionalMetrics bool
    CloudProvider string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    AccountId string
    IsDimensionalMetrics bool
    cloud_provider string
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    account_id string
    is_dimensional_metrics bool
    cloudProvider String
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    accountId String
    isDimensionalMetrics Boolean
    cloudProvider string
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    accountId string
    isDimensionalMetrics boolean
    cloud_provider str
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    account_id str
    is_dimensional_metrics bool
    cloudProvider String
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    accountId String
    isDimensionalMetrics Boolean

    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 newrelic logo
    Viewing docs for New Relic v5.76.5
    published on Friday, Sep 11, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial