1. Packages
  2. Fortios
  3. API Docs
  4. firewall
  5. getPolicylist
Fortios v0.0.6 published on Tuesday, Jul 9, 2024 by pulumiverse

fortios.firewall.getPolicylist

Explore with Pulumi AI

Fortios v0.0.6 published on Tuesday, Jul 9, 2024 by pulumiverse

Provides a list of fortios.firewall.Policy.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as fortios from "@pulumi/fortios";

const sample1 = fortios.firewall.getPolicylist({});
export const output1 = sample1;
const sample2 = fortios.firewall.getPolicylist({
    filter: "schedule==always&action==accept,action==deny",
});
export const sample2Output = sample2.then(sample2 => sample2.policyidlists);
Copy
import pulumi
import pulumi_fortios as fortios

sample1 = fortios.firewall.get_policylist()
pulumi.export("output1", sample1)
sample2 = fortios.firewall.get_policylist(filter="schedule==always&action==accept,action==deny")
pulumi.export("sample2Output", sample2.policyidlists)
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-fortios/sdk/go/fortios/firewall"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		sample1, err := firewall.GetPolicylist(ctx, nil, nil)
		if err != nil {
			return err
		}
		ctx.Export("output1", sample1)
		sample2, err := firewall.GetPolicylist(ctx, &firewall.GetPolicylistArgs{
			Filter: pulumi.StringRef("schedule==always&action==accept,action==deny"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("sample2Output", sample2.Policyidlists)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Fortios = Pulumi.Fortios;

return await Deployment.RunAsync(() => 
{
    var sample1 = Fortios.Firewall.GetPolicylist.Invoke();

    var sample2 = Fortios.Firewall.GetPolicylist.Invoke(new()
    {
        Filter = "schedule==always&action==accept,action==deny",
    });

    return new Dictionary<string, object?>
    {
        ["output1"] = sample1,
        ["sample2Output"] = sample2.Apply(getPolicylistResult => getPolicylistResult.Policyidlists),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.fortios.firewall.FirewallFunctions;
import com.pulumi.fortios.firewall.inputs.GetPolicylistArgs;
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 sample1 = FirewallFunctions.getPolicylist();

        ctx.export("output1", sample1.applyValue(getPolicylistResult -> getPolicylistResult));
        final var sample2 = FirewallFunctions.getPolicylist(GetPolicylistArgs.builder()
            .filter("schedule==always&action==accept,action==deny")
            .build());

        ctx.export("sample2Output", sample2.applyValue(getPolicylistResult -> getPolicylistResult.policyidlists()));
    }
}
Copy
variables:
  sample1:
    fn::invoke:
      Function: fortios:firewall:getPolicylist
      Arguments: {}
  sample2:
    fn::invoke:
      Function: fortios:firewall:getPolicylist
      Arguments:
        filter: schedule==always&action==accept,action==deny
outputs:
  output1: ${sample1}
  sample2Output: ${sample2.policyidlists}
Copy

Using getPolicylist

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 getPolicylist(args: GetPolicylistArgs, opts?: InvokeOptions): Promise<GetPolicylistResult>
function getPolicylistOutput(args: GetPolicylistOutputArgs, opts?: InvokeOptions): Output<GetPolicylistResult>
Copy
def get_policylist(filter: Optional[str] = None,
                   vdomparam: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetPolicylistResult
def get_policylist_output(filter: Optional[pulumi.Input[str]] = None,
                   vdomparam: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetPolicylistResult]
Copy
func GetPolicylist(ctx *Context, args *GetPolicylistArgs, opts ...InvokeOption) (*GetPolicylistResult, error)
func GetPolicylistOutput(ctx *Context, args *GetPolicylistOutputArgs, opts ...InvokeOption) GetPolicylistResultOutput
Copy

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

public static class GetPolicylist 
{
    public static Task<GetPolicylistResult> InvokeAsync(GetPolicylistArgs args, InvokeOptions? opts = null)
    public static Output<GetPolicylistResult> Invoke(GetPolicylistInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetPolicylistResult> getPolicylist(GetPolicylistArgs args, InvokeOptions options)
public static Output<GetPolicylistResult> getPolicylist(GetPolicylistArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: fortios:firewall/getPolicylist:getPolicylist
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Filter string
A filter used to scope the list. See Filter results of datasource.
Vdomparam Changes to this property will trigger replacement. string
Specifies the vdom to which the data source will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
Filter string
A filter used to scope the list. See Filter results of datasource.
Vdomparam Changes to this property will trigger replacement. string
Specifies the vdom to which the data source will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
filter String
A filter used to scope the list. See Filter results of datasource.
vdomparam Changes to this property will trigger replacement. String
Specifies the vdom to which the data source will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
filter string
A filter used to scope the list. See Filter results of datasource.
vdomparam Changes to this property will trigger replacement. string
Specifies the vdom to which the data source will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
filter str
A filter used to scope the list. See Filter results of datasource.
vdomparam Changes to this property will trigger replacement. str
Specifies the vdom to which the data source will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
filter String
A filter used to scope the list. See Filter results of datasource.
vdomparam Changes to this property will trigger replacement. String
Specifies the vdom to which the data source will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.

getPolicylist Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Policyidlists List<int>
A list of the fortios.firewall.Policy.
Filter string
Vdomparam string
Id string
The provider-assigned unique ID for this managed resource.
Policyidlists []int
A list of the fortios.firewall.Policy.
Filter string
Vdomparam string
id String
The provider-assigned unique ID for this managed resource.
policyidlists List<Integer>
A list of the fortios.firewall.Policy.
filter String
vdomparam String
id string
The provider-assigned unique ID for this managed resource.
policyidlists number[]
A list of the fortios.firewall.Policy.
filter string
vdomparam string
id str
The provider-assigned unique ID for this managed resource.
policyidlists Sequence[int]
A list of the fortios.firewall.Policy.
filter str
vdomparam str
id String
The provider-assigned unique ID for this managed resource.
policyidlists List<Number>
A list of the fortios.firewall.Policy.
filter String
vdomparam String

Package Details

Repository
fortios pulumiverse/pulumi-fortios
License
Apache-2.0
Notes
This Pulumi package is based on the fortios Terraform Provider.
Fortios v0.0.6 published on Tuesday, Jul 9, 2024 by pulumiverse