newrelic.getCloudAccount
Explore with Pulumi AI
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 account_id is specified on the resource the provider level account_id 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.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 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
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?: InvokeOptions): Output<GetCloudAccountResult>def get_cloud_account(account_id: Optional[str] = None,
                      cloud_provider: Optional[str] = None,
                      name: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetCloudAccountResult
def get_cloud_account_output(account_id: Optional[pulumi.Input[str]] = None,
                      cloud_provider: Optional[pulumi.Input[str]] = None,
                      name: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = 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 CompletableFuture<GetCloudAccountResult> getCloudAccount(GetCloudAccountArgs args, InvokeOptions options)
public static Output<GetCloudAccountResult> getCloudAccount(GetCloudAccountArgs args, InvokeOptions options)
fn::invoke:
  function: newrelic:index/getCloudAccount:getCloudAccount
  arguments:
    # arguments dictionaryThe 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.
 
- 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.
 
- 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.
 
- 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.
 
- 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.
 
- 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.
 
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 
- Cloud
Provider string - Id string
 - The provider-assigned unique ID for this managed resource.
 - Name string
 - Account
Id string 
- cloud
Provider String - id String
 - The provider-assigned unique ID for this managed resource.
 - name String
 - account
Id String 
- cloud
Provider string - id string
 - The provider-assigned unique ID for this managed resource.
 - name string
 - account
Id string 
- cloud_
provider str - id str
 - The provider-assigned unique ID for this managed resource.
 - name str
 - account_
id str 
- cloud
Provider String - id String
 - The provider-assigned unique ID for this managed resource.
 - name String
 - account
Id String 
Package Details
- Repository
 - New Relic pulumi/pulumi-newrelic
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
newrelicTerraform Provider.