1. Packages
  2. Packages
  3. Unifi
  4. API Docs
  5. firewall
  6. getZone
Viewing docs for Unifi v0.3.0
published on Wednesday, Jul 8, 2026 by Pulumiverse
unifi logo
Viewing docs for Unifi v0.3.0
published on Wednesday, Jul 8, 2026 by Pulumiverse

    The unifi.firewall.Zone datsources allows retrieving existing firewall zone details from the UniFi controller by the zone name.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as unifi from "@pulumiverse/unifi";
    
    const vpn = unifi.firewall.getZone({
        name: "Vpn",
    });
    const gateway = unifi.firewall.getZone({
        name: "Gateway",
    });
    const internal = unifi.firewall.getZone({
        name: "Internal",
    });
    const external = unifi.firewall.getZone({
        name: "External",
    });
    const hotspot = unifi.firewall.getZone({
        name: "Hotspot",
    });
    
    import pulumi
    import pulumi_unifi as unifi
    
    vpn = unifi.firewall.get_zone(name="Vpn")
    gateway = unifi.firewall.get_zone(name="Gateway")
    internal = unifi.firewall.get_zone(name="Internal")
    external = unifi.firewall.get_zone(name="External")
    hotspot = unifi.firewall.get_zone(name="Hotspot")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-unifi/sdk/go/unifi/firewall"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := firewall.LookupZone(ctx, &firewall.LookupZoneArgs{
    			Name: "Vpn",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = firewall.LookupZone(ctx, &firewall.LookupZoneArgs{
    			Name: "Gateway",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = firewall.LookupZone(ctx, &firewall.LookupZoneArgs{
    			Name: "Internal",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = firewall.LookupZone(ctx, &firewall.LookupZoneArgs{
    			Name: "External",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = firewall.LookupZone(ctx, &firewall.LookupZoneArgs{
    			Name: "Hotspot",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Unifi = Pulumiverse.Unifi;
    
    return await Deployment.RunAsync(() => 
    {
        var vpn = Unifi.Firewall.GetZone.Invoke(new()
        {
            Name = "Vpn",
        });
    
        var gateway = Unifi.Firewall.GetZone.Invoke(new()
        {
            Name = "Gateway",
        });
    
        var @internal = Unifi.Firewall.GetZone.Invoke(new()
        {
            Name = "Internal",
        });
    
        var external = Unifi.Firewall.GetZone.Invoke(new()
        {
            Name = "External",
        });
    
        var hotspot = Unifi.Firewall.GetZone.Invoke(new()
        {
            Name = "Hotspot",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.unifi.firewall.FirewallFunctions;
    import com.pulumi.unifi.firewall.inputs.GetZoneArgs;
    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 vpn = FirewallFunctions.getZone(GetZoneArgs.builder()
                .name("Vpn")
                .build());
    
            final var gateway = FirewallFunctions.getZone(GetZoneArgs.builder()
                .name("Gateway")
                .build());
    
            final var internal = FirewallFunctions.getZone(GetZoneArgs.builder()
                .name("Internal")
                .build());
    
            final var external = FirewallFunctions.getZone(GetZoneArgs.builder()
                .name("External")
                .build());
    
            final var hotspot = FirewallFunctions.getZone(GetZoneArgs.builder()
                .name("Hotspot")
                .build());
    
        }
    }
    
    variables:
      vpn:
        fn::invoke:
          function: unifi:firewall:getZone
          arguments:
            name: Vpn
      gateway:
        fn::invoke:
          function: unifi:firewall:getZone
          arguments:
            name: Gateway
      internal:
        fn::invoke:
          function: unifi:firewall:getZone
          arguments:
            name: Internal
      external:
        fn::invoke:
          function: unifi:firewall:getZone
          arguments:
            name: External
      hotspot:
        fn::invoke:
          function: unifi:firewall:getZone
          arguments:
            name: Hotspot
    
    pulumi {
      required_providers {
        unifi = {
          source = "pulumi/unifi"
        }
      }
    }
    
    data "unifi_firewall_getzone" "vpn" {
      name = "Vpn"
    }
    data "unifi_firewall_getzone" "gateway" {
      name = "Gateway"
    }
    data "unifi_firewall_getzone" "internal" {
      name = "Internal"
    }
    data "unifi_firewall_getzone" "external" {
      name = "External"
    }
    data "unifi_firewall_getzone" "hotspot" {
      name = "Hotspot"
    }
    

    Using getZone

    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 getZone(args: GetZoneArgs, opts?: InvokeOptions): Promise<GetZoneResult>
    function getZoneOutput(args: GetZoneOutputArgs, opts?: InvokeOptions): Output<GetZoneResult>
    def get_zone(name: Optional[str] = None,
                 site: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetZoneResult
    def get_zone_output(name: pulumi.Input[Optional[str]] = None,
                 site: pulumi.Input[Optional[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetZoneResult]
    func LookupZone(ctx *Context, args *LookupZoneArgs, opts ...InvokeOption) (*LookupZoneResult, error)
    func LookupZoneOutput(ctx *Context, args *LookupZoneOutputArgs, opts ...InvokeOption) LookupZoneResultOutput

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

    public static class GetZone 
    {
        public static Task<GetZoneResult> InvokeAsync(GetZoneArgs args, InvokeOptions? opts = null)
        public static Output<GetZoneResult> Invoke(GetZoneInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetZoneResult> getZone(GetZoneArgs args, InvokeOptions options)
    public static Output<GetZoneResult> getZone(GetZoneArgs args, InvokeOptions options)
    
    fn::invoke:
      function: unifi:firewall/getZone:getZone
      arguments:
        # arguments dictionary
    data "unifi_firewall_get_zone" "name" {
        # arguments
    }

    The following arguments are supported:

    Name string
    The name of the firewall zone.
    Site string
    The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
    Name string
    The name of the firewall zone.
    Site string
    The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
    name string
    The name of the firewall zone.
    site string
    The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
    name String
    The name of the firewall zone.
    site String
    The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
    name string
    The name of the firewall zone.
    site string
    The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
    name str
    The name of the firewall zone.
    site str
    The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
    name String
    The name of the firewall zone.
    site String
    The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.

    getZone Result

    The following output properties are available:

    Id string
    The unique identifier of this resource.
    Name string
    The name of the firewall zone.
    Networks List<string>
    List of network IDs that this firewall zone contains.
    Site string
    The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
    Id string
    The unique identifier of this resource.
    Name string
    The name of the firewall zone.
    Networks []string
    List of network IDs that this firewall zone contains.
    Site string
    The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
    id string
    The unique identifier of this resource.
    name string
    The name of the firewall zone.
    networks list(string)
    List of network IDs that this firewall zone contains.
    site string
    The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
    id String
    The unique identifier of this resource.
    name String
    The name of the firewall zone.
    networks List<String>
    List of network IDs that this firewall zone contains.
    site String
    The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
    id string
    The unique identifier of this resource.
    name string
    The name of the firewall zone.
    networks string[]
    List of network IDs that this firewall zone contains.
    site string
    The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
    id str
    The unique identifier of this resource.
    name str
    The name of the firewall zone.
    networks Sequence[str]
    List of network IDs that this firewall zone contains.
    site str
    The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.
    id String
    The unique identifier of this resource.
    name String
    The name of the firewall zone.
    networks List<String>
    List of network IDs that this firewall zone contains.
    site String
    The name of the UniFi site where this resource should be applied. If not specified, the default site will be used.

    Package Details

    Repository
    unifi pulumiverse/pulumi-unifi
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the unifi Terraform Provider.
    unifi logo
    Viewing docs for Unifi v0.3.0
    published on Wednesday, Jul 8, 2026 by Pulumiverse

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial