Civo

Pulumi Official
Package maintained by Pulumi
v2.2.4 published on Friday, Jul 29, 2022 by Pulumi

getFirewall

Retrieve information about a firewall for use in other resources.

This data source provides all of the firewall’s properties as configured on your Civo account.

Firewalls may be looked up by id or name, and you can optionally pass region if you want to make a lookup for an expecific firewall inside that region.

Example Usage

using Pulumi;
using Civo = Pulumi.Civo;

class MyStack : Stack
{
    public MyStack()
    {
        var test = Output.Create(Civo.GetFirewall.InvokeAsync(new Civo.GetFirewallArgs
        {
            Name = "test-firewall",
            Region = "NYC1",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-civo/sdk/v2/go/civo"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := civo.LookupFirewall(ctx, &GetFirewallArgs{
			Name:   pulumi.StringRef("test-firewall"),
			Region: pulumi.StringRef("NYC1"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.civo.CivoFunctions;
import com.pulumi.civo.inputs.GetFirewallArgs;
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 test = CivoFunctions.getFirewall(GetFirewallArgs.builder()
            .name("test-firewall")
            .region("NYC1")
            .build());

    }
}
import pulumi
import pulumi_civo as civo

test = civo.get_firewall(name="test-firewall",
    region="NYC1")
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";

const test = pulumi.output(civo.getFirewall({
    name: "test-firewall",
    region: "NYC1",
}));
variables:
  test:
    Fn::Invoke:
      Function: civo:getFirewall
      Arguments:
        name: test-firewall
        region: NYC1

Using getFirewall

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 getFirewall(args: GetFirewallArgs, opts?: InvokeOptions): Promise<GetFirewallResult>
function getFirewallOutput(args: GetFirewallOutputArgs, opts?: InvokeOptions): Output<GetFirewallResult>
def get_firewall(id: Optional[str] = None,
                 name: Optional[str] = None,
                 region: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetFirewallResult
def get_firewall_output(id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 region: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetFirewallResult]
func LookupFirewall(ctx *Context, args *LookupFirewallArgs, opts ...InvokeOption) (*LookupFirewallResult, error)
func LookupFirewallOutput(ctx *Context, args *LookupFirewallOutputArgs, opts ...InvokeOption) LookupFirewallResultOutput

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

public static class GetFirewall 
{
    public static Task<GetFirewallResult> InvokeAsync(GetFirewallArgs args, InvokeOptions? opts = null)
    public static Output<GetFirewallResult> Invoke(GetFirewallInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetFirewallResult> getFirewall(GetFirewallArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: civo:index/getFirewall:getFirewall
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Id string
Name string
Region string
Id string
Name string
Region string
id String
name String
region String
id string
name string
region string
id str
name str
region str
id String
name String
region String

getFirewall Result

The following output properties are available:

NetworkId string
Id string
Name string
Region string
NetworkId string
Id string
Name string
Region string
networkId String
id String
name String
region String
networkId string
id string
name string
region string
network_id str
id str
name str
region str
networkId String
id String
name String
region String

Package Details

Repository
https://github.com/pulumi/pulumi-civo
License
Apache-2.0
Notes

This Pulumi package is based on the civo Terraform Provider.