Viewing docs for New Relic v4.20.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Viewing docs for New Relic v4.20.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Use this data source to get information about a specific account in New Relic. Accounts can be located by ID or name. Exactly one of the two attributes is required.
Example Usage
using System.Collections.Generic;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var acc = NewRelic.GetAccount.Invoke(new()
{
Scope = "global",
});
});
package main
import (
"github.com/pulumi/pulumi-newrelic/sdk/v4/go/newrelic"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := newrelic.GetAccount(ctx, &GetAccountArgs{
Scope: pulumi.StringRef("global"),
}, nil)
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.NewrelicFunctions;
import com.pulumi.newrelic.inputs.GetAccountArgs;
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) {
final var acc = NewrelicFunctions.getAccount(GetAccountArgs.builder()
.scope("global")
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const acc = pulumi.output(newrelic.getAccount({
scope: "global",
}));
import pulumi
import pulumi_newrelic as newrelic
acc = newrelic.get_account(scope="global")
variables:
acc:
Fn::Invoke:
Function: newrelic:getAccount
Arguments:
scope: global
Using getAccount
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 getAccount(args: GetAccountArgs, opts?: InvokeOptions): Promise<GetAccountResult>
function getAccountOutput(args: GetAccountOutputArgs, opts?: InvokeOptions): Output<GetAccountResult>def get_account(account_id: Optional[int] = None,
name: Optional[str] = None,
scope: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetAccountResult
def get_account_output(account_id: Optional[pulumi.Input[int]] = None,
name: Optional[pulumi.Input[str]] = None,
scope: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetAccountResult]func GetAccount(ctx *Context, args *GetAccountArgs, opts ...InvokeOption) (*GetAccountResult, error)
func GetAccountOutput(ctx *Context, args *GetAccountOutputArgs, opts ...InvokeOption) GetAccountResultOutput> Note: This function is named GetAccount in the Go SDK.
public static class GetAccount
{
public static Task<GetAccountResult> InvokeAsync(GetAccountArgs args, InvokeOptions? opts = null)
public static Output<GetAccountResult> Invoke(GetAccountInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetAccountResult> getAccount(GetAccountArgs args, InvokeOptions options)
public static Output<GetAccountResult> getAccount(GetAccountArgs args, InvokeOptions options)
fn::invoke:
function: newrelic:index/getAccount:getAccount
arguments:
# arguments dictionaryThe following arguments are supported:
- account_
id int - The account ID in New Relic.
- name str
- The account name in New Relic.
- scope str
- The scope of the account in New Relic. Valid values are "global" and "in_region". Defaults to "in_region".
getAccount Result
The following output properties are available:
- id str
- The provider-assigned unique ID for this managed resource.
- account_
id int - name str
- scope str
Package Details
- Repository
- New Relic pulumi/pulumi-newrelic
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
newrelicTerraform Provider.
Viewing docs for New Relic v4.20.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
