Cloudflare v6.10.1 published on Wednesday, Oct 22, 2025 by Pulumi
cloudflare.getAccounts
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 dictionaryThe following arguments are supported:
getAccounts Result
The following output properties are available:
Supporting Types
GetAccountsResult  
- created_on str
- Timestamp for the creation of the account
- id str
- Identifier
- name str
- Account name
- settings
GetAccounts Result Settings 
- Account settings
- type str
- Available values: "standard", "enterprise".
GetAccountsResultSettings   
- AbuseContact stringEmail 
- Sets an abuse contact email to notify for abuse reports.
- EnforceTwofactor bool
- Indicates whether membership in this account requires that Two-Factor Authentication is enabled
- AbuseContact stringEmail 
- Sets an abuse contact email to notify for abuse reports.
- EnforceTwofactor bool
- Indicates whether membership in this account requires that Two-Factor Authentication is enabled
- abuseContact StringEmail 
- Sets an abuse contact email to notify for abuse reports.
- enforceTwofactor Boolean
- Indicates whether membership in this account requires that Two-Factor Authentication is enabled
- abuseContact stringEmail 
- Sets an abuse contact email to notify for abuse reports.
- enforceTwofactor boolean
- Indicates whether membership in this account requires that Two-Factor Authentication is enabled
- abuse_contact_ stremail 
- Sets an abuse contact email to notify for abuse reports.
- enforce_twofactor bool
- Indicates whether membership in this account requires that Two-Factor Authentication is enabled
- abuseContact StringEmail 
- Sets an abuse contact email to notify for abuse reports.
- enforceTwofactor Boolean
- Indicates whether membership in this account requires that Two-Factor Authentication is enabled
Package Details
- Repository
- Cloudflare pulumi/pulumi-cloudflare
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the cloudflareTerraform Provider.
