1. Packages
  2. Linode Provider
  3. API Docs
  4. getFirewallTemplates
Linode v5.6.0 published on Wednesday, Dec 24, 2025 by Pulumi
linode logo
Linode v5.6.0 published on Wednesday, Dec 24, 2025 by Pulumi

    Provides information about all Linode Firewall Templates.

    Example Usage

    The following example shows how one might use this data source to list all available Firewall Templates:

    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    const all = linode.getFirewallTemplates({});
    export const firewallTemplateSlugs = all.then(all => all.firewallTemplates);
    
    import pulumi
    import pulumi_linode as linode
    
    all = linode.get_firewall_templates()
    pulumi.export("firewallTemplateSlugs", all.firewall_templates)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-linode/sdk/v5/go/linode"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		all, err := linode.GetFirewallTemplates(ctx, &linode.GetFirewallTemplatesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firewallTemplateSlugs", all.FirewallTemplates)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Linode = Pulumi.Linode;
    
    return await Deployment.RunAsync(() => 
    {
        var all = Linode.GetFirewallTemplates.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["firewallTemplateSlugs"] = all.Apply(getFirewallTemplatesResult => getFirewallTemplatesResult.FirewallTemplates),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.linode.LinodeFunctions;
    import com.pulumi.linode.inputs.GetFirewallTemplatesArgs;
    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 all = LinodeFunctions.getFirewallTemplates(GetFirewallTemplatesArgs.builder()
                .build());
    
            ctx.export("firewallTemplateSlugs", all.firewallTemplates());
        }
    }
    
    variables:
      all:
        fn::invoke:
          function: linode:getFirewallTemplates
          arguments: {}
    outputs:
      firewallTemplateSlugs: ${all.firewallTemplates}
    

    Or with some filters to get a subset of the results.

    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    const filtered = linode.getFirewallTemplates({
        filters: [{
            name: "slug",
            values: ["public"],
            matchBy: "exact",
        }],
    });
    export const firewallTemplateSlugs = filtered.then(filtered => filtered.firewallTemplates);
    
    import pulumi
    import pulumi_linode as linode
    
    filtered = linode.get_firewall_templates(filters=[{
        "name": "slug",
        "values": ["public"],
        "match_by": "exact",
    }])
    pulumi.export("firewallTemplateSlugs", filtered.firewall_templates)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-linode/sdk/v5/go/linode"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		filtered, err := linode.GetFirewallTemplates(ctx, &linode.GetFirewallTemplatesArgs{
    			Filters: []linode.GetFirewallTemplatesFilter{
    				{
    					Name: "slug",
    					Values: []string{
    						"public",
    					},
    					MatchBy: pulumi.StringRef("exact"),
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firewallTemplateSlugs", filtered.FirewallTemplates)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Linode = Pulumi.Linode;
    
    return await Deployment.RunAsync(() => 
    {
        var filtered = Linode.GetFirewallTemplates.Invoke(new()
        {
            Filters = new[]
            {
                new Linode.Inputs.GetFirewallTemplatesFilterInputArgs
                {
                    Name = "slug",
                    Values = new[]
                    {
                        "public",
                    },
                    MatchBy = "exact",
                },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["firewallTemplateSlugs"] = filtered.Apply(getFirewallTemplatesResult => getFirewallTemplatesResult.FirewallTemplates),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.linode.LinodeFunctions;
    import com.pulumi.linode.inputs.GetFirewallTemplatesArgs;
    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 filtered = LinodeFunctions.getFirewallTemplates(GetFirewallTemplatesArgs.builder()
                .filters(GetFirewallTemplatesFilterArgs.builder()
                    .name("slug")
                    .values("public")
                    .matchBy("exact")
                    .build())
                .build());
    
            ctx.export("firewallTemplateSlugs", filtered.firewallTemplates());
        }
    }
    
    variables:
      filtered:
        fn::invoke:
          function: linode:getFirewallTemplates
          arguments:
            filters:
              - name: slug
                values:
                  - public
                matchBy: exact
    outputs:
      firewallTemplateSlugs: ${filtered.firewallTemplates}
    

    Filterable Fields

    • slug

    Using getFirewallTemplates

    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 getFirewallTemplates(args: GetFirewallTemplatesArgs, opts?: InvokeOptions): Promise<GetFirewallTemplatesResult>
    function getFirewallTemplatesOutput(args: GetFirewallTemplatesOutputArgs, opts?: InvokeOptions): Output<GetFirewallTemplatesResult>
    def get_firewall_templates(filters: Optional[Sequence[GetFirewallTemplatesFilter]] = None,
                               opts: Optional[InvokeOptions] = None) -> GetFirewallTemplatesResult
    def get_firewall_templates_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetFirewallTemplatesFilterArgs]]]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetFirewallTemplatesResult]
    func GetFirewallTemplates(ctx *Context, args *GetFirewallTemplatesArgs, opts ...InvokeOption) (*GetFirewallTemplatesResult, error)
    func GetFirewallTemplatesOutput(ctx *Context, args *GetFirewallTemplatesOutputArgs, opts ...InvokeOption) GetFirewallTemplatesResultOutput

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

    public static class GetFirewallTemplates 
    {
        public static Task<GetFirewallTemplatesResult> InvokeAsync(GetFirewallTemplatesArgs args, InvokeOptions? opts = null)
        public static Output<GetFirewallTemplatesResult> Invoke(GetFirewallTemplatesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetFirewallTemplatesResult> getFirewallTemplates(GetFirewallTemplatesArgs args, InvokeOptions options)
    public static Output<GetFirewallTemplatesResult> getFirewallTemplates(GetFirewallTemplatesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: linode:index/getFirewallTemplates:getFirewallTemplates
      arguments:
        # arguments dictionary

    The following arguments are supported:

    getFirewallTemplates Result

    The following output properties are available:

    Supporting Types

    GetFirewallTemplatesFilter

    Name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values List<string>
    A list of values for the filter to allow. These values should all be in string form.
    MatchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    Name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values []string
    A list of values for the filter to allow. These values should all be in string form.
    MatchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    name String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values List<String>
    A list of values for the filter to allow. These values should all be in string form.
    matchBy String
    The method to match the field by. (exact, regex, substring; default exact)
    name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values string[]
    A list of values for the filter to allow. These values should all be in string form.
    matchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    name str
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values Sequence[str]
    A list of values for the filter to allow. These values should all be in string form.
    match_by str
    The method to match the field by. (exact, regex, substring; default exact)
    name String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values List<String>
    A list of values for the filter to allow. These values should all be in string form.
    matchBy String
    The method to match the field by. (exact, regex, substring; default exact)

    GetFirewallTemplatesFirewallTemplate

    InboundPolicy string
    The default behavior for inbound traffic.
    Inbounds List<GetFirewallTemplatesFirewallTemplateInbound>
    A list of firewall rules specifying allowed inbound network traffic.
    OutboundPolicy string
    The default behavior for outbound traffic.
    Outbounds List<GetFirewallTemplatesFirewallTemplateOutbound>
    A list of firewall rules specifying allowed outbound network traffic.
    Slug string
    The slug of the firewall template.
    InboundPolicy string
    The default behavior for inbound traffic.
    Inbounds []GetFirewallTemplatesFirewallTemplateInbound
    A list of firewall rules specifying allowed inbound network traffic.
    OutboundPolicy string
    The default behavior for outbound traffic.
    Outbounds []GetFirewallTemplatesFirewallTemplateOutbound
    A list of firewall rules specifying allowed outbound network traffic.
    Slug string
    The slug of the firewall template.
    inboundPolicy String
    The default behavior for inbound traffic.
    inbounds List<GetFirewallTemplatesFirewallTemplateInbound>
    A list of firewall rules specifying allowed inbound network traffic.
    outboundPolicy String
    The default behavior for outbound traffic.
    outbounds List<GetFirewallTemplatesFirewallTemplateOutbound>
    A list of firewall rules specifying allowed outbound network traffic.
    slug String
    The slug of the firewall template.
    inboundPolicy string
    The default behavior for inbound traffic.
    inbounds GetFirewallTemplatesFirewallTemplateInbound[]
    A list of firewall rules specifying allowed inbound network traffic.
    outboundPolicy string
    The default behavior for outbound traffic.
    outbounds GetFirewallTemplatesFirewallTemplateOutbound[]
    A list of firewall rules specifying allowed outbound network traffic.
    slug string
    The slug of the firewall template.
    inbound_policy str
    The default behavior for inbound traffic.
    inbounds Sequence[GetFirewallTemplatesFirewallTemplateInbound]
    A list of firewall rules specifying allowed inbound network traffic.
    outbound_policy str
    The default behavior for outbound traffic.
    outbounds Sequence[GetFirewallTemplatesFirewallTemplateOutbound]
    A list of firewall rules specifying allowed outbound network traffic.
    slug str
    The slug of the firewall template.
    inboundPolicy String
    The default behavior for inbound traffic.
    inbounds List<Property Map>
    A list of firewall rules specifying allowed inbound network traffic.
    outboundPolicy String
    The default behavior for outbound traffic.
    outbounds List<Property Map>
    A list of firewall rules specifying allowed outbound network traffic.
    slug String
    The slug of the firewall template.

    GetFirewallTemplatesFirewallTemplateInbound

    Action string
    Description string
    Ipv4s List<string>
    Ipv6s List<string>
    Label string
    Ports string
    Protocol string
    Action string
    Description string
    Ipv4s []string
    Ipv6s []string
    Label string
    Ports string
    Protocol string
    action String
    description String
    ipv4s List<String>
    ipv6s List<String>
    label String
    ports String
    protocol String
    action string
    description string
    ipv4s string[]
    ipv6s string[]
    label string
    ports string
    protocol string
    action str
    description str
    ipv4s Sequence[str]
    ipv6s Sequence[str]
    label str
    ports str
    protocol str
    action String
    description String
    ipv4s List<String>
    ipv6s List<String>
    label String
    ports String
    protocol String

    GetFirewallTemplatesFirewallTemplateOutbound

    Action string
    Description string
    Ipv4s List<string>
    Ipv6s List<string>
    Label string
    Ports string
    Protocol string
    Action string
    Description string
    Ipv4s []string
    Ipv6s []string
    Label string
    Ports string
    Protocol string
    action String
    description String
    ipv4s List<String>
    ipv6s List<String>
    label String
    ports String
    protocol String
    action string
    description string
    ipv4s string[]
    ipv6s string[]
    label string
    ports string
    protocol string
    action str
    description str
    ipv4s Sequence[str]
    ipv6s Sequence[str]
    label str
    ports str
    protocol str
    action String
    description String
    ipv4s List<String>
    ipv6s List<String>
    label String
    ports String
    protocol String

    Package Details

    Repository
    Linode pulumi/pulumi-linode
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the linode Terraform Provider.
    linode logo
    Linode v5.6.0 published on Wednesday, Dec 24, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate