1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getAccounts
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

cloudflare.getAccounts

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleAccounts = cloudflare.getAccounts({
        direction: "desc",
        name: "example.com",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_accounts = cloudflare.get_accounts(direction="desc",
        name="example.com")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudflare.LookupAccounts(ctx, &cloudflare.LookupAccountsArgs{
    			Direction: pulumi.StringRef("desc"),
    			Name:      pulumi.StringRef("example.com"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleAccounts = Cloudflare.GetAccounts.Invoke(new()
        {
            Direction = "desc",
            Name = "example.com",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.CloudflareFunctions;
    import com.pulumi.cloudflare.inputs.GetAccountsArgs;
    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 exampleAccounts = CloudflareFunctions.getAccounts(GetAccountsArgs.builder()
                .direction("desc")
                .name("example.com")
                .build());
    
        }
    }
    
    variables:
      exampleAccounts:
        fn::invoke:
          function: cloudflare:getAccounts
          arguments:
            direction: desc
            name: example.com
    

    Using getAccounts

    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 getAccounts(args: GetAccountsArgs, opts?: InvokeOptions): Promise<GetAccountsResult>
    function getAccountsOutput(args: GetAccountsOutputArgs, opts?: InvokeOptions): Output<GetAccountsResult>
    def get_accounts(direction: Optional[str] = None,
                     max_items: Optional[int] = None,
                     name: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetAccountsResult
    def get_accounts_output(direction: Optional[pulumi.Input[str]] = None,
                     max_items: Optional[pulumi.Input[int]] = None,
                     name: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetAccountsResult]
    func LookupAccounts(ctx *Context, args *LookupAccountsArgs, opts ...InvokeOption) (*LookupAccountsResult, error)
    func LookupAccountsOutput(ctx *Context, args *LookupAccountsOutputArgs, opts ...InvokeOption) LookupAccountsResultOutput

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

    public static class GetAccounts 
    {
        public static Task<GetAccountsResult> InvokeAsync(GetAccountsArgs args, InvokeOptions? opts = null)
        public static Output<GetAccountsResult> Invoke(GetAccountsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAccountsResult> getAccounts(GetAccountsArgs args, InvokeOptions options)
    public static Output<GetAccountsResult> getAccounts(GetAccountsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: cloudflare:index/getAccounts:getAccounts
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Direction string
    Direction to order results. Available values: "asc", "desc".
    MaxItems int
    Max items to fetch, default: 1000
    Name string
    Name of the account.
    Direction string
    Direction to order results. Available values: "asc", "desc".
    MaxItems int
    Max items to fetch, default: 1000
    Name string
    Name of the account.
    direction String
    Direction to order results. Available values: "asc", "desc".
    maxItems Integer
    Max items to fetch, default: 1000
    name String
    Name of the account.
    direction string
    Direction to order results. Available values: "asc", "desc".
    maxItems number
    Max items to fetch, default: 1000
    name string
    Name of the account.
    direction str
    Direction to order results. Available values: "asc", "desc".
    max_items int
    Max items to fetch, default: 1000
    name str
    Name of the account.
    direction String
    Direction to order results. Available values: "asc", "desc".
    maxItems Number
    Max items to fetch, default: 1000
    name String
    Name of the account.

    getAccounts Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Results List<GetAccountsResult>
    The items returned by the data source
    Direction string
    Direction to order results. Available values: "asc", "desc".
    MaxItems int
    Max items to fetch, default: 1000
    Name string
    Name of the account.
    Id string
    The provider-assigned unique ID for this managed resource.
    Results []GetAccountsResult
    The items returned by the data source
    Direction string
    Direction to order results. Available values: "asc", "desc".
    MaxItems int
    Max items to fetch, default: 1000
    Name string
    Name of the account.
    id String
    The provider-assigned unique ID for this managed resource.
    results List<GetAccountsResult>
    The items returned by the data source
    direction String
    Direction to order results. Available values: "asc", "desc".
    maxItems Integer
    Max items to fetch, default: 1000
    name String
    Name of the account.
    id string
    The provider-assigned unique ID for this managed resource.
    results GetAccountsResult[]
    The items returned by the data source
    direction string
    Direction to order results. Available values: "asc", "desc".
    maxItems number
    Max items to fetch, default: 1000
    name string
    Name of the account.
    id str
    The provider-assigned unique ID for this managed resource.
    results Sequence[GetAccountsResult]
    The items returned by the data source
    direction str
    Direction to order results. Available values: "asc", "desc".
    max_items int
    Max items to fetch, default: 1000
    name str
    Name of the account.
    id String
    The provider-assigned unique ID for this managed resource.
    results List<Property Map>
    The items returned by the data source
    direction String
    Direction to order results. Available values: "asc", "desc".
    maxItems Number
    Max items to fetch, default: 1000
    name String
    Name of the account.

    Supporting Types

    GetAccountsResult

    CreatedOn string
    Timestamp for the creation of the account
    Id string
    Identifier
    Name string
    Account name
    Settings GetAccountsResultSettings
    Account settings
    CreatedOn string
    Timestamp for the creation of the account
    Id string
    Identifier
    Name string
    Account name
    Settings GetAccountsResultSettings
    Account settings
    createdOn String
    Timestamp for the creation of the account
    id String
    Identifier
    name String
    Account name
    settings GetAccountsResultSettings
    Account settings
    createdOn string
    Timestamp for the creation of the account
    id string
    Identifier
    name string
    Account name
    settings GetAccountsResultSettings
    Account settings
    created_on str
    Timestamp for the creation of the account
    id str
    Identifier
    name str
    Account name
    settings GetAccountsResultSettings
    Account settings
    createdOn String
    Timestamp for the creation of the account
    id String
    Identifier
    name String
    Account name
    settings Property Map
    Account settings

    GetAccountsResultSettings

    AbuseContactEmail string
    Sets an abuse contact email to notify for abuse reports.
    DefaultNameservers string
    Specifies the default nameservers to be used for new zones added to this account.

    Deprecated: This attribute is deprecated.

    EnforceTwofactor bool
    Indicates whether membership in this account requires that Two-Factor Authentication is enabled
    UseAccountCustomNsByDefault bool

    Indicates whether new zones should use the account-level custom nameservers by default.

    Deprecated in favor of DNS Settings.

    Deprecated: This attribute is deprecated.

    AbuseContactEmail string
    Sets an abuse contact email to notify for abuse reports.
    DefaultNameservers string
    Specifies the default nameservers to be used for new zones added to this account.

    Deprecated: This attribute is deprecated.

    EnforceTwofactor bool
    Indicates whether membership in this account requires that Two-Factor Authentication is enabled
    UseAccountCustomNsByDefault bool

    Indicates whether new zones should use the account-level custom nameservers by default.

    Deprecated in favor of DNS Settings.

    Deprecated: This attribute is deprecated.

    abuseContactEmail String
    Sets an abuse contact email to notify for abuse reports.
    defaultNameservers String
    Specifies the default nameservers to be used for new zones added to this account.

    Deprecated: This attribute is deprecated.

    enforceTwofactor Boolean
    Indicates whether membership in this account requires that Two-Factor Authentication is enabled
    useAccountCustomNsByDefault Boolean

    Indicates whether new zones should use the account-level custom nameservers by default.

    Deprecated in favor of DNS Settings.

    Deprecated: This attribute is deprecated.

    abuseContactEmail string
    Sets an abuse contact email to notify for abuse reports.
    defaultNameservers string
    Specifies the default nameservers to be used for new zones added to this account.

    Deprecated: This attribute is deprecated.

    enforceTwofactor boolean
    Indicates whether membership in this account requires that Two-Factor Authentication is enabled
    useAccountCustomNsByDefault boolean

    Indicates whether new zones should use the account-level custom nameservers by default.

    Deprecated in favor of DNS Settings.

    Deprecated: This attribute is deprecated.

    abuse_contact_email str
    Sets an abuse contact email to notify for abuse reports.
    default_nameservers str
    Specifies the default nameservers to be used for new zones added to this account.

    Deprecated: This attribute is deprecated.

    enforce_twofactor bool
    Indicates whether membership in this account requires that Two-Factor Authentication is enabled
    use_account_custom_ns_by_default bool

    Indicates whether new zones should use the account-level custom nameservers by default.

    Deprecated in favor of DNS Settings.

    Deprecated: This attribute is deprecated.

    abuseContactEmail String
    Sets an abuse contact email to notify for abuse reports.
    defaultNameservers String
    Specifies the default nameservers to be used for new zones added to this account.

    Deprecated: This attribute is deprecated.

    enforceTwofactor Boolean
    Indicates whether membership in this account requires that Two-Factor Authentication is enabled
    useAccountCustomNsByDefault Boolean

    Indicates whether new zones should use the account-level custom nameservers by default.

    Deprecated in favor of DNS Settings.

    Deprecated: This attribute is deprecated.

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo
    Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi