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

cloudflare.getZones

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 exampleZones = cloudflare.getZones({
        account: {
            id: "id",
            name: "name",
        },
        direction: "desc",
        name: "name",
        order: "status",
        status: "initializing",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_zones = cloudflare.get_zones(account={
            "id": "id",
            "name": "name",
        },
        direction="desc",
        name="name",
        order="status",
        status="initializing")
    
    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.LookupZones(ctx, &cloudflare.LookupZonesArgs{
    			Account: cloudflare.GetZonesAccount{
    				Id:   pulumi.StringRef("id"),
    				Name: pulumi.StringRef("name"),
    			},
    			Direction: pulumi.StringRef("desc"),
    			Name:      pulumi.StringRef("name"),
    			Order:     pulumi.StringRef("status"),
    			Status:    pulumi.StringRef("initializing"),
    		}, 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 exampleZones = Cloudflare.GetZones.Invoke(new()
        {
            Account = new Cloudflare.Inputs.GetZonesAccountInputArgs
            {
                Id = "id",
                Name = "name",
            },
            Direction = "desc",
            Name = "name",
            Order = "status",
            Status = "initializing",
        });
    
    });
    
    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.GetZonesArgs;
    import com.pulumi.cloudflare.inputs.GetZonesAccountArgs;
    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 exampleZones = CloudflareFunctions.getZones(GetZonesArgs.builder()
                .account(GetZonesAccountArgs.builder()
                    .id("id")
                    .name("name")
                    .build())
                .direction("desc")
                .name("name")
                .order("status")
                .status("initializing")
                .build());
    
        }
    }
    
    variables:
      exampleZones:
        fn::invoke:
          function: cloudflare:getZones
          arguments:
            account:
              id: id
              name: name
            direction: desc
            name: name
            order: status
            status: initializing
    

    Using getZones

    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 getZones(args: GetZonesArgs, opts?: InvokeOptions): Promise<GetZonesResult>
    function getZonesOutput(args: GetZonesOutputArgs, opts?: InvokeOptions): Output<GetZonesResult>
    def get_zones(account: Optional[GetZonesAccount] = None,
                  direction: Optional[str] = None,
                  match: Optional[str] = None,
                  max_items: Optional[int] = None,
                  name: Optional[str] = None,
                  order: Optional[str] = None,
                  status: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetZonesResult
    def get_zones_output(account: Optional[pulumi.Input[GetZonesAccountArgs]] = None,
                  direction: Optional[pulumi.Input[str]] = None,
                  match: Optional[pulumi.Input[str]] = None,
                  max_items: Optional[pulumi.Input[int]] = None,
                  name: Optional[pulumi.Input[str]] = None,
                  order: Optional[pulumi.Input[str]] = None,
                  status: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetZonesResult]
    func LookupZones(ctx *Context, args *LookupZonesArgs, opts ...InvokeOption) (*LookupZonesResult, error)
    func LookupZonesOutput(ctx *Context, args *LookupZonesOutputArgs, opts ...InvokeOption) LookupZonesResultOutput

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

    public static class GetZones 
    {
        public static Task<GetZonesResult> InvokeAsync(GetZonesArgs args, InvokeOptions? opts = null)
        public static Output<GetZonesResult> Invoke(GetZonesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetZonesResult> getZones(GetZonesArgs args, InvokeOptions options)
    public static Output<GetZonesResult> getZones(GetZonesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: cloudflare:index/getZones:getZones
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Account GetZonesAccount
    Direction string
    Match string
    MaxItems int
    Name string
    Order string
    Status string
    Account GetZonesAccount
    Direction string
    Match string
    MaxItems int
    Name string
    Order string
    Status string
    account GetZonesAccount
    direction String
    match String
    maxItems Integer
    name String
    order String
    status String
    account GetZonesAccount
    direction string
    match string
    maxItems number
    name string
    order string
    status string
    account Property Map
    direction String
    match String
    maxItems Number
    name String
    order String
    status String

    getZones Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Match string
    Results List<GetZonesResult>
    Account GetZonesAccount
    Direction string
    MaxItems int
    Name string
    Order string
    Status string
    Id string
    The provider-assigned unique ID for this managed resource.
    Match string
    Results []GetZonesResult
    Account GetZonesAccount
    Direction string
    MaxItems int
    Name string
    Order string
    Status string
    id String
    The provider-assigned unique ID for this managed resource.
    match String
    results List<GetZonesResult>
    account GetZonesAccount
    direction String
    maxItems Integer
    name String
    order String
    status String
    id string
    The provider-assigned unique ID for this managed resource.
    match string
    results GetZonesResult[]
    account GetZonesAccount
    direction string
    maxItems number
    name string
    order string
    status string
    id str
    The provider-assigned unique ID for this managed resource.
    match str
    results Sequence[GetZonesResult]
    account GetZonesAccount
    direction str
    max_items int
    name str
    order str
    status str
    id String
    The provider-assigned unique ID for this managed resource.
    match String
    results List<Property Map>
    account Property Map
    direction String
    maxItems Number
    name String
    order String
    status String

    Supporting Types

    GetZonesAccount

    Id string
    An account ID
    Name string
    An account Name. Optional filter operators can be provided to extend refine the search:

    • equal (default)
    • not_equal
    • starts_with
    • ends_with
    • contains
    • starts_with_case_sensitive
    • ends_with_case_sensitive
    • contains_case_sensitive
    Id string
    An account ID
    Name string
    An account Name. Optional filter operators can be provided to extend refine the search:

    • equal (default)
    • not_equal
    • starts_with
    • ends_with
    • contains
    • starts_with_case_sensitive
    • ends_with_case_sensitive
    • contains_case_sensitive
    id String
    An account ID
    name String
    An account Name. Optional filter operators can be provided to extend refine the search:

    • equal (default)
    • not_equal
    • starts_with
    • ends_with
    • contains
    • starts_with_case_sensitive
    • ends_with_case_sensitive
    • contains_case_sensitive
    id string
    An account ID
    name string
    An account Name. Optional filter operators can be provided to extend refine the search:

    • equal (default)
    • not_equal
    • starts_with
    • ends_with
    • contains
    • starts_with_case_sensitive
    • ends_with_case_sensitive
    • contains_case_sensitive
    id str
    An account ID
    name str
    An account Name. Optional filter operators can be provided to extend refine the search:

    • equal (default)
    • not_equal
    • starts_with
    • ends_with
    • contains
    • starts_with_case_sensitive
    • ends_with_case_sensitive
    • contains_case_sensitive
    id String
    An account ID
    name String
    An account Name. Optional filter operators can be provided to extend refine the search:

    • equal (default)
    • not_equal
    • starts_with
    • ends_with
    • contains
    • starts_with_case_sensitive
    • ends_with_case_sensitive
    • contains_case_sensitive

    GetZonesResult

    Account GetZonesResultAccount
    The account the zone belongs to
    ActivatedOn string
    The last time proof of ownership was detected and the zone was made active
    CreatedOn string
    When the zone was created
    DevelopmentMode double
    The interval (in seconds) from when development mode expires (positive integer) or last expired (negative integer) for the domain. If development mode has never been enabled, this value is 0.
    Id string
    Identifier
    Meta GetZonesResultMeta
    Metadata about the zone
    ModifiedOn string
    When the zone was last modified
    Name string
    The domain name
    NameServers List<string>
    The name servers Cloudflare assigns to a zone
    OriginalDnshost string
    DNS host at the time of switching to Cloudflare
    OriginalNameServers List<string>
    Original name servers before moving to Cloudflare
    OriginalRegistrar string
    Registrar for the domain at the time of switching to Cloudflare
    Owner GetZonesResultOwner
    The owner of the zone
    Paused bool
    Indicates whether the zone is only using Cloudflare DNS services. A true value means the zone will not receive security or performance benefits.
    Status string
    The zone status on Cloudflare. Available values: "initializing", "pending", "active", "moved".
    Type string
    A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. Available values: "full", "partial", "secondary", "internal".
    VanityNameServers List<string>
    An array of domains used for custom name servers. This is only available for Business and Enterprise plans.
    VerificationKey string
    Verification key for partial zone setup.
    Account GetZonesResultAccount
    The account the zone belongs to
    ActivatedOn string
    The last time proof of ownership was detected and the zone was made active
    CreatedOn string
    When the zone was created
    DevelopmentMode float64
    The interval (in seconds) from when development mode expires (positive integer) or last expired (negative integer) for the domain. If development mode has never been enabled, this value is 0.
    Id string
    Identifier
    Meta GetZonesResultMeta
    Metadata about the zone
    ModifiedOn string
    When the zone was last modified
    Name string
    The domain name
    NameServers []string
    The name servers Cloudflare assigns to a zone
    OriginalDnshost string
    DNS host at the time of switching to Cloudflare
    OriginalNameServers []string
    Original name servers before moving to Cloudflare
    OriginalRegistrar string
    Registrar for the domain at the time of switching to Cloudflare
    Owner GetZonesResultOwner
    The owner of the zone
    Paused bool
    Indicates whether the zone is only using Cloudflare DNS services. A true value means the zone will not receive security or performance benefits.
    Status string
    The zone status on Cloudflare. Available values: "initializing", "pending", "active", "moved".
    Type string
    A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. Available values: "full", "partial", "secondary", "internal".
    VanityNameServers []string
    An array of domains used for custom name servers. This is only available for Business and Enterprise plans.
    VerificationKey string
    Verification key for partial zone setup.
    account GetZonesResultAccount
    The account the zone belongs to
    activatedOn String
    The last time proof of ownership was detected and the zone was made active
    createdOn String
    When the zone was created
    developmentMode Double
    The interval (in seconds) from when development mode expires (positive integer) or last expired (negative integer) for the domain. If development mode has never been enabled, this value is 0.
    id String
    Identifier
    meta GetZonesResultMeta
    Metadata about the zone
    modifiedOn String
    When the zone was last modified
    name String
    The domain name
    nameServers List<String>
    The name servers Cloudflare assigns to a zone
    originalDnshost String
    DNS host at the time of switching to Cloudflare
    originalNameServers List<String>
    Original name servers before moving to Cloudflare
    originalRegistrar String
    Registrar for the domain at the time of switching to Cloudflare
    owner GetZonesResultOwner
    The owner of the zone
    paused Boolean
    Indicates whether the zone is only using Cloudflare DNS services. A true value means the zone will not receive security or performance benefits.
    status String
    The zone status on Cloudflare. Available values: "initializing", "pending", "active", "moved".
    type String
    A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. Available values: "full", "partial", "secondary", "internal".
    vanityNameServers List<String>
    An array of domains used for custom name servers. This is only available for Business and Enterprise plans.
    verificationKey String
    Verification key for partial zone setup.
    account GetZonesResultAccount
    The account the zone belongs to
    activatedOn string
    The last time proof of ownership was detected and the zone was made active
    createdOn string
    When the zone was created
    developmentMode number
    The interval (in seconds) from when development mode expires (positive integer) or last expired (negative integer) for the domain. If development mode has never been enabled, this value is 0.
    id string
    Identifier
    meta GetZonesResultMeta
    Metadata about the zone
    modifiedOn string
    When the zone was last modified
    name string
    The domain name
    nameServers string[]
    The name servers Cloudflare assigns to a zone
    originalDnshost string
    DNS host at the time of switching to Cloudflare
    originalNameServers string[]
    Original name servers before moving to Cloudflare
    originalRegistrar string
    Registrar for the domain at the time of switching to Cloudflare
    owner GetZonesResultOwner
    The owner of the zone
    paused boolean
    Indicates whether the zone is only using Cloudflare DNS services. A true value means the zone will not receive security or performance benefits.
    status string
    The zone status on Cloudflare. Available values: "initializing", "pending", "active", "moved".
    type string
    A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. Available values: "full", "partial", "secondary", "internal".
    vanityNameServers string[]
    An array of domains used for custom name servers. This is only available for Business and Enterprise plans.
    verificationKey string
    Verification key for partial zone setup.
    account GetZonesResultAccount
    The account the zone belongs to
    activated_on str
    The last time proof of ownership was detected and the zone was made active
    created_on str
    When the zone was created
    development_mode float
    The interval (in seconds) from when development mode expires (positive integer) or last expired (negative integer) for the domain. If development mode has never been enabled, this value is 0.
    id str
    Identifier
    meta GetZonesResultMeta
    Metadata about the zone
    modified_on str
    When the zone was last modified
    name str
    The domain name
    name_servers Sequence[str]
    The name servers Cloudflare assigns to a zone
    original_dnshost str
    DNS host at the time of switching to Cloudflare
    original_name_servers Sequence[str]
    Original name servers before moving to Cloudflare
    original_registrar str
    Registrar for the domain at the time of switching to Cloudflare
    owner GetZonesResultOwner
    The owner of the zone
    paused bool
    Indicates whether the zone is only using Cloudflare DNS services. A true value means the zone will not receive security or performance benefits.
    status str
    The zone status on Cloudflare. Available values: "initializing", "pending", "active", "moved".
    type str
    A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. Available values: "full", "partial", "secondary", "internal".
    vanity_name_servers Sequence[str]
    An array of domains used for custom name servers. This is only available for Business and Enterprise plans.
    verification_key str
    Verification key for partial zone setup.
    account Property Map
    The account the zone belongs to
    activatedOn String
    The last time proof of ownership was detected and the zone was made active
    createdOn String
    When the zone was created
    developmentMode Number
    The interval (in seconds) from when development mode expires (positive integer) or last expired (negative integer) for the domain. If development mode has never been enabled, this value is 0.
    id String
    Identifier
    meta Property Map
    Metadata about the zone
    modifiedOn String
    When the zone was last modified
    name String
    The domain name
    nameServers List<String>
    The name servers Cloudflare assigns to a zone
    originalDnshost String
    DNS host at the time of switching to Cloudflare
    originalNameServers List<String>
    Original name servers before moving to Cloudflare
    originalRegistrar String
    Registrar for the domain at the time of switching to Cloudflare
    owner Property Map
    The owner of the zone
    paused Boolean
    Indicates whether the zone is only using Cloudflare DNS services. A true value means the zone will not receive security or performance benefits.
    status String
    The zone status on Cloudflare. Available values: "initializing", "pending", "active", "moved".
    type String
    A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. Available values: "full", "partial", "secondary", "internal".
    vanityNameServers List<String>
    An array of domains used for custom name servers. This is only available for Business and Enterprise plans.
    verificationKey String
    Verification key for partial zone setup.

    GetZonesResultAccount

    Id string
    Identifier
    Name string
    The name of the account
    Id string
    Identifier
    Name string
    The name of the account
    id String
    Identifier
    name String
    The name of the account
    id string
    Identifier
    name string
    The name of the account
    id str
    Identifier
    name str
    The name of the account
    id String
    Identifier
    name String
    The name of the account

    GetZonesResultMeta

    CdnOnly bool
    The zone is only configured for CDN
    CustomCertificateQuota int
    Number of Custom Certificates the zone can have
    DnsOnly bool
    The zone is only configured for DNS
    FoundationDns bool
    The zone is setup with Foundation DNS
    PageRuleQuota int
    Number of Page Rules a zone can have
    PhishingDetected bool
    The zone has been flagged for phishing
    Step int
    CdnOnly bool
    The zone is only configured for CDN
    CustomCertificateQuota int
    Number of Custom Certificates the zone can have
    DnsOnly bool
    The zone is only configured for DNS
    FoundationDns bool
    The zone is setup with Foundation DNS
    PageRuleQuota int
    Number of Page Rules a zone can have
    PhishingDetected bool
    The zone has been flagged for phishing
    Step int
    cdnOnly Boolean
    The zone is only configured for CDN
    customCertificateQuota Integer
    Number of Custom Certificates the zone can have
    dnsOnly Boolean
    The zone is only configured for DNS
    foundationDns Boolean
    The zone is setup with Foundation DNS
    pageRuleQuota Integer
    Number of Page Rules a zone can have
    phishingDetected Boolean
    The zone has been flagged for phishing
    step Integer
    cdnOnly boolean
    The zone is only configured for CDN
    customCertificateQuota number
    Number of Custom Certificates the zone can have
    dnsOnly boolean
    The zone is only configured for DNS
    foundationDns boolean
    The zone is setup with Foundation DNS
    pageRuleQuota number
    Number of Page Rules a zone can have
    phishingDetected boolean
    The zone has been flagged for phishing
    step number
    cdn_only bool
    The zone is only configured for CDN
    custom_certificate_quota int
    Number of Custom Certificates the zone can have
    dns_only bool
    The zone is only configured for DNS
    foundation_dns bool
    The zone is setup with Foundation DNS
    page_rule_quota int
    Number of Page Rules a zone can have
    phishing_detected bool
    The zone has been flagged for phishing
    step int
    cdnOnly Boolean
    The zone is only configured for CDN
    customCertificateQuota Number
    Number of Custom Certificates the zone can have
    dnsOnly Boolean
    The zone is only configured for DNS
    foundationDns Boolean
    The zone is setup with Foundation DNS
    pageRuleQuota Number
    Number of Page Rules a zone can have
    phishingDetected Boolean
    The zone has been flagged for phishing
    step Number

    GetZonesResultOwner

    Id string
    Identifier
    Name string
    Name of the owner
    Type string
    The type of owner
    Id string
    Identifier
    Name string
    Name of the owner
    Type string
    The type of owner
    id String
    Identifier
    name String
    Name of the owner
    type String
    The type of owner
    id string
    Identifier
    name string
    Name of the owner
    type string
    The type of owner
    id str
    Identifier
    name str
    Name of the owner
    type str
    The type of owner
    id String
    Identifier
    name String
    Name of the owner
    type String
    The type of owner

    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