1. Packages
  2. Cloudflare
  3. API Docs
  4. getZones
Cloudflare v5.24.0 published on Thursday, Mar 28, 2024 by Pulumi

cloudflare.getZones

Explore with Pulumi AI

cloudflare logo
Cloudflare v5.24.0 published on Thursday, Mar 28, 2024 by Pulumi

    Use this data source to look up Zone results for use in other resources.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const example = cloudflare.getZones({
        filter: {
            accountId: "f037e56e89293a057740de681ac9abbe",
            status: "active",
        },
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example = cloudflare.get_zones(filter=cloudflare.GetZonesFilterArgs(
        account_id="f037e56e89293a057740de681ac9abbe",
        status="active",
    ))
    
    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.GetZones(ctx, &cloudflare.GetZonesArgs{
    			Filter: cloudflare.GetZonesFilter{
    				AccountId: pulumi.StringRef("f037e56e89293a057740de681ac9abbe"),
    				Status:    pulumi.StringRef("active"),
    			},
    		}, 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.GetZones.Invoke(new()
        {
            Filter = new Cloudflare.Inputs.GetZonesFilterInputArgs
            {
                AccountId = "f037e56e89293a057740de681ac9abbe",
                Status = "active",
            },
        });
    
    });
    
    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.GetZonesFilterArgs;
    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.getZones(GetZonesArgs.builder()
                .filter(GetZonesFilterArgs.builder()
                    .accountId("f037e56e89293a057740de681ac9abbe")
                    .status("active")
                    .build())
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: cloudflare:getZones
          Arguments:
            filter:
              accountId: f037e56e89293a057740de681ac9abbe
              status: active
    

    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(filter: Optional[GetZonesFilter] = None,
                  opts: Optional[InvokeOptions] = None) -> GetZonesResult
    def get_zones_output(filter: Optional[pulumi.Input[GetZonesFilterArgs]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetZonesResult]
    func GetZones(ctx *Context, args *GetZonesArgs, opts ...InvokeOption) (*GetZonesResult, error)
    func GetZonesOutput(ctx *Context, args *GetZonesOutputArgs, opts ...InvokeOption) GetZonesResultOutput

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

    The following arguments are supported:

    Filter GetZonesFilter
    One or more values used to look up zone records. If more than one value is given all values must match in order to be included.
    Filter GetZonesFilter
    One or more values used to look up zone records. If more than one value is given all values must match in order to be included.
    filter GetZonesFilter
    One or more values used to look up zone records. If more than one value is given all values must match in order to be included.
    filter GetZonesFilter
    One or more values used to look up zone records. If more than one value is given all values must match in order to be included.
    filter GetZonesFilter
    One or more values used to look up zone records. If more than one value is given all values must match in order to be included.
    filter Property Map
    One or more values used to look up zone records. If more than one value is given all values must match in order to be included.

    getZones Result

    The following output properties are available:

    Filter GetZonesFilter
    One or more values used to look up zone records. If more than one value is given all values must match in order to be included.
    Id string
    The provider-assigned unique ID for this managed resource.
    Zones List<GetZonesZone>
    A list of zone objects.
    Filter GetZonesFilter
    One or more values used to look up zone records. If more than one value is given all values must match in order to be included.
    Id string
    The provider-assigned unique ID for this managed resource.
    Zones []GetZonesZone
    A list of zone objects.
    filter GetZonesFilter
    One or more values used to look up zone records. If more than one value is given all values must match in order to be included.
    id String
    The provider-assigned unique ID for this managed resource.
    zones List<GetZonesZone>
    A list of zone objects.
    filter GetZonesFilter
    One or more values used to look up zone records. If more than one value is given all values must match in order to be included.
    id string
    The provider-assigned unique ID for this managed resource.
    zones GetZonesZone[]
    A list of zone objects.
    filter GetZonesFilter
    One or more values used to look up zone records. If more than one value is given all values must match in order to be included.
    id str
    The provider-assigned unique ID for this managed resource.
    zones Sequence[GetZonesZone]
    A list of zone objects.
    filter Property Map
    One or more values used to look up zone records. If more than one value is given all values must match in order to be included.
    id String
    The provider-assigned unique ID for this managed resource.
    zones List<Property Map>
    A list of zone objects.

    Supporting Types

    GetZonesFilter

    AccountId string
    The account identifier to target for the resource.
    LookupType string
    The type of search to perform for the name value when querying the zone API. Available values: contains, exact. Defaults to exact.
    Match string
    A RE2 compatible regular expression to filter the results. This is performed client side whereas the name and lookup_type are performed on the Cloudflare server side.
    Name string
    A string value to search for.
    Paused bool
    Paused status of the zone to lookup. Defaults to false.
    Status string
    Status of the zone to lookup.
    AccountId string
    The account identifier to target for the resource.
    LookupType string
    The type of search to perform for the name value when querying the zone API. Available values: contains, exact. Defaults to exact.
    Match string
    A RE2 compatible regular expression to filter the results. This is performed client side whereas the name and lookup_type are performed on the Cloudflare server side.
    Name string
    A string value to search for.
    Paused bool
    Paused status of the zone to lookup. Defaults to false.
    Status string
    Status of the zone to lookup.
    accountId String
    The account identifier to target for the resource.
    lookupType String
    The type of search to perform for the name value when querying the zone API. Available values: contains, exact. Defaults to exact.
    match String
    A RE2 compatible regular expression to filter the results. This is performed client side whereas the name and lookup_type are performed on the Cloudflare server side.
    name String
    A string value to search for.
    paused Boolean
    Paused status of the zone to lookup. Defaults to false.
    status String
    Status of the zone to lookup.
    accountId string
    The account identifier to target for the resource.
    lookupType string
    The type of search to perform for the name value when querying the zone API. Available values: contains, exact. Defaults to exact.
    match string
    A RE2 compatible regular expression to filter the results. This is performed client side whereas the name and lookup_type are performed on the Cloudflare server side.
    name string
    A string value to search for.
    paused boolean
    Paused status of the zone to lookup. Defaults to false.
    status string
    Status of the zone to lookup.
    account_id str
    The account identifier to target for the resource.
    lookup_type str
    The type of search to perform for the name value when querying the zone API. Available values: contains, exact. Defaults to exact.
    match str
    A RE2 compatible regular expression to filter the results. This is performed client side whereas the name and lookup_type are performed on the Cloudflare server side.
    name str
    A string value to search for.
    paused bool
    Paused status of the zone to lookup. Defaults to false.
    status str
    Status of the zone to lookup.
    accountId String
    The account identifier to target for the resource.
    lookupType String
    The type of search to perform for the name value when querying the zone API. Available values: contains, exact. Defaults to exact.
    match String
    A RE2 compatible regular expression to filter the results. This is performed client side whereas the name and lookup_type are performed on the Cloudflare server side.
    name String
    A string value to search for.
    paused Boolean
    Paused status of the zone to lookup. Defaults to false.
    status String
    Status of the zone to lookup.

    GetZonesZone

    Id string
    The zone ID.
    Name string
    Zone name.
    Id string
    The zone ID.
    Name string
    Zone name.
    id String
    The zone ID.
    name String
    Zone name.
    id string
    The zone ID.
    name string
    Zone name.
    id str
    The zone ID.
    name str
    Zone name.
    id String
    The zone ID.
    name String
    Zone name.

    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.24.0 published on Thursday, Mar 28, 2024 by Pulumi