1. Packages
  2. New Relic
  3. API Docs
  4. getCloudAccount
New Relic v5.25.3 published on Tuesday, Jun 25, 2024 by Pulumi

newrelic.getCloudAccount

Explore with Pulumi AI

newrelic logo
New Relic v5.25.3 published on Tuesday, Jun 25, 2024 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 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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: newrelic:index/getCloudAccount:getCloudAccount
      arguments:
        # arguments dictionary

    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.
    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.
    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.
    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.
    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.
    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.

    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
    CloudProvider string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    AccountId string
    cloudProvider String
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    accountId String
    cloudProvider string
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    accountId string
    cloud_provider str
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    account_id str
    cloudProvider String
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    accountId String

    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
    New Relic v5.25.3 published on Tuesday, Jun 25, 2024 by Pulumi