1. Packages
  2. Packages
  3. Fastly Provider
  4. API Docs
  5. getDnsZones
Viewing docs for Fastly v12.2.1
published on Saturday, Jun 6, 2026 by Pulumi
fastly logo
Viewing docs for Fastly v12.2.1
published on Saturday, Jun 6, 2026 by Pulumi

    Use this data source to get a list of Fastly DNS Zones.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as fastly from "@pulumi/fastly";
    
    const example = fastly.getDnsZones({});
    export const fastlyDnsZonesAll = example.then(example => example.zones);
    
    import pulumi
    import pulumi_fastly as fastly
    
    example = fastly.get_dns_zones()
    pulumi.export("fastlyDnsZonesAll", example.zones)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-fastly/sdk/v12/go/fastly"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := fastly.GetDnsZones(ctx, &fastly.GetDnsZonesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("fastlyDnsZonesAll", example.Zones)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Fastly = Pulumi.Fastly;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Fastly.GetDnsZones.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["fastlyDnsZonesAll"] = example.Apply(getDnsZonesResult => getDnsZonesResult.Zones),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.fastly.FastlyFunctions;
    import com.pulumi.fastly.inputs.GetDnsZonesArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 = FastlyFunctions.getDnsZones(GetDnsZonesArgs.builder()
                .build());
    
            ctx.export("fastlyDnsZonesAll", example.zones());
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: fastly:getDnsZones
          arguments: {}
    outputs:
      fastlyDnsZonesAll: ${example.zones}
    
    pulumi {
      required_providers {
        fastly = {
          source = "pulumi/fastly"
        }
      }
    }
    
    data "fastly_getdnszones" "example" {
    }
    
    output "fastlyDnsZonesAll" {
      value = data.fastly_getdnszones.example.zones
    }
    

    Using getDnsZones

    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 getDnsZones(args: GetDnsZonesArgs, opts?: InvokeOptions): Promise<GetDnsZonesResult>
    function getDnsZonesOutput(args: GetDnsZonesOutputArgs, opts?: InvokeOptions): Output<GetDnsZonesResult>
    def get_dns_zones(total: Optional[int] = None,
                      opts: Optional[InvokeOptions] = None) -> GetDnsZonesResult
    def get_dns_zones_output(total: pulumi.Input[Optional[int]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetDnsZonesResult]
    func GetDnsZones(ctx *Context, args *GetDnsZonesArgs, opts ...InvokeOption) (*GetDnsZonesResult, error)
    func GetDnsZonesOutput(ctx *Context, args *GetDnsZonesOutputArgs, opts ...InvokeOption) GetDnsZonesResultOutput

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

    public static class GetDnsZones 
    {
        public static Task<GetDnsZonesResult> InvokeAsync(GetDnsZonesArgs args, InvokeOptions? opts = null)
        public static Output<GetDnsZonesResult> Invoke(GetDnsZonesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDnsZonesResult> getDnsZones(GetDnsZonesArgs args, InvokeOptions options)
    public static Output<GetDnsZonesResult> getDnsZones(GetDnsZonesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: fastly:index/getDnsZones:getDnsZones
      arguments:
        # arguments dictionary
    data "fastly_getdnszones" "name" {
        # arguments
    }

    The following arguments are supported:

    Total int
    The total number of DNS zones returned.
    Total int
    The total number of DNS zones returned.
    total number
    The total number of DNS zones returned.
    total Integer
    The total number of DNS zones returned.
    total number
    The total number of DNS zones returned.
    total int
    The total number of DNS zones returned.
    total Number
    The total number of DNS zones returned.

    getDnsZones Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Total int
    The total number of DNS zones returned.
    Zones List<GetDnsZonesZone>
    A list of DNS zones.
    Id string
    The provider-assigned unique ID for this managed resource.
    Total int
    The total number of DNS zones returned.
    Zones []GetDnsZonesZone
    A list of DNS zones.
    id string
    The provider-assigned unique ID for this managed resource.
    total number
    The total number of DNS zones returned.
    zones list(object)
    A list of DNS zones.
    id String
    The provider-assigned unique ID for this managed resource.
    total Integer
    The total number of DNS zones returned.
    zones List<GetDnsZonesZone>
    A list of DNS zones.
    id string
    The provider-assigned unique ID for this managed resource.
    total number
    The total number of DNS zones returned.
    zones GetDnsZonesZone[]
    A list of DNS zones.
    id str
    The provider-assigned unique ID for this managed resource.
    total int
    The total number of DNS zones returned.
    zones Sequence[GetDnsZonesZone]
    A list of DNS zones.
    id String
    The provider-assigned unique ID for this managed resource.
    total Number
    The total number of DNS zones returned.
    zones List<Property Map>
    A list of DNS zones.

    Supporting Types

    GetDnsZonesZone

    Description string
    A freeform descriptive note.
    Id string
    Zone Identifier (UUID).
    Name string
    The domain name for the zone.
    Description string
    A freeform descriptive note.
    Id string
    Zone Identifier (UUID).
    Name string
    The domain name for the zone.
    description string
    A freeform descriptive note.
    id string
    Zone Identifier (UUID).
    name string
    The domain name for the zone.
    description String
    A freeform descriptive note.
    id String
    Zone Identifier (UUID).
    name String
    The domain name for the zone.
    description string
    A freeform descriptive note.
    id string
    Zone Identifier (UUID).
    name string
    The domain name for the zone.
    description str
    A freeform descriptive note.
    id str
    Zone Identifier (UUID).
    name str
    The domain name for the zone.
    description String
    A freeform descriptive note.
    id String
    Zone Identifier (UUID).
    name String
    The domain name for the zone.

    Package Details

    Repository
    Fastly pulumi/pulumi-fastly
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the fastly Terraform Provider.
    fastly logo
    Viewing docs for Fastly v12.2.1
    published on Saturday, Jun 6, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial