published on Friday, Sep 11, 2026 by Pulumi
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 dictionarydata "newrelic_get_cloud_account" "name" {
# arguments
}The following arguments are supported:
- 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 boolMetrics - Set to
trueto 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 whencloudProvideris"gcp". Defaults tofalse.
- 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 boolMetrics - Set to
trueto 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 whencloudProvideris"gcp". Defaults tofalse.
- 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_ boolmetrics - Set to
trueto 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 whencloudProvideris"gcp". Defaults tofalse.
- 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 BooleanMetrics - Set to
trueto 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 whencloudProvideris"gcp". Defaults tofalse.
- 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 booleanMetrics - Set to
trueto 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 whencloudProvideris"gcp". Defaults tofalse.
- 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_ boolmetrics - Set to
trueto 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 whencloudProvideris"gcp". Defaults tofalse.
- 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 BooleanMetrics - Set to
trueto 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 whencloudProvideris"gcp". Defaults tofalse.
getCloudAccount Result
The following output properties are available:
- Cloud
Provider string - Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Account
Id string - Is
Dimensional boolMetrics
- Cloud
Provider string - Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Account
Id string - Is
Dimensional boolMetrics
- cloud_
provider string - id string
- The provider-assigned unique ID for this managed resource.
- name string
- account_
id string - is_
dimensional_ boolmetrics
- cloud
Provider String - id String
- The provider-assigned unique ID for this managed resource.
- name String
- account
Id String - is
Dimensional BooleanMetrics
- cloud
Provider string - id string
- The provider-assigned unique ID for this managed resource.
- name string
- account
Id string - is
Dimensional booleanMetrics
- cloud_
provider str - id str
- The provider-assigned unique ID for this managed resource.
- name str
- account_
id str - is_
dimensional_ boolmetrics
- cloud
Provider String - id String
- The provider-assigned unique ID for this managed resource.
- name String
- account
Id String - is
Dimensional BooleanMetrics
Package Details
- Repository
- New Relic pulumi/pulumi-newrelic
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
newrelicTerraform Provider.
published on Friday, Sep 11, 2026 by Pulumi