1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getAccounts
Cloudflare v5.44.0 published on Wednesday, Nov 27, 2024 by Pulumi

cloudflare.getAccounts

Explore with Pulumi AI

cloudflare logo
Cloudflare v5.44.0 published on Wednesday, Nov 27, 2024 by Pulumi

    Data source for looking up Cloudflare Accounts.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const example = cloudflare.getAccounts({
        name: "example account",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example = cloudflare.get_accounts(name="example account")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudflare.GetAccounts(ctx, &cloudflare.GetAccountsArgs{
    			Name: pulumi.StringRef("example account"),
    		}, 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 example = Cloudflare.GetAccounts.Invoke(new()
        {
            Name = "example account",
        });
    
    });
    
    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 example = CloudflareFunctions.getAccounts(GetAccountsArgs.builder()
                .name("example account")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: cloudflare:getAccounts
          Arguments:
            name: example account
    

    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(name: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetAccountsResult
    def get_accounts_output(name: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetAccountsResult]
    func GetAccounts(ctx *Context, args *GetAccountsArgs, opts ...InvokeOption) (*GetAccountsResult, error)
    func GetAccountsOutput(ctx *Context, args *GetAccountsOutputArgs, opts ...InvokeOption) GetAccountsResultOutput

    > Note: This function is named GetAccounts 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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: cloudflare:index/getAccounts:getAccounts
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The account name to target for the resource.
    Name string
    The account name to target for the resource.
    name String
    The account name to target for the resource.
    name string
    The account name to target for the resource.
    name str
    The account name to target for the resource.
    name String
    The account name to target for the resource.

    getAccounts Result

    The following output properties are available:

    Accounts List<GetAccountsAccount>
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The account name to target for the resource.
    Accounts []GetAccountsAccount
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The account name to target for the resource.
    accounts List<GetAccountsAccount>
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The account name to target for the resource.
    accounts GetAccountsAccount[]
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The account name to target for the resource.
    accounts Sequence[GetAccountsAccount]
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The account name to target for the resource.
    accounts List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The account name to target for the resource.

    Supporting Types

    GetAccountsAccount

    EnforceTwofactor bool
    Whether 2FA is enforced on the account.
    Id string
    Account ID.
    Name string
    Account name.
    Type string
    Account subscription type.
    EnforceTwofactor bool
    Whether 2FA is enforced on the account.
    Id string
    Account ID.
    Name string
    Account name.
    Type string
    Account subscription type.
    enforceTwofactor Boolean
    Whether 2FA is enforced on the account.
    id String
    Account ID.
    name String
    Account name.
    type String
    Account subscription type.
    enforceTwofactor boolean
    Whether 2FA is enforced on the account.
    id string
    Account ID.
    name string
    Account name.
    type string
    Account subscription type.
    enforce_twofactor bool
    Whether 2FA is enforced on the account.
    id str
    Account ID.
    name str
    Account name.
    type str
    Account subscription type.
    enforceTwofactor Boolean
    Whether 2FA is enforced on the account.
    id String
    Account ID.
    name String
    Account name.
    type String
    Account subscription type.

    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 v5.44.0 published on Wednesday, Nov 27, 2024 by Pulumi