1. Packages
  2. Civo Provider
  3. API Docs
  4. getFirewall
civo 1.1.5 published on Thursday, Feb 6, 2025 by civo

civo.getFirewall

Explore with Pulumi AI

civo 1.1.5 published on Thursday, Feb 6, 2025 by civo

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 a specific firewall inside that region.

Example Usage

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

const test = civo.getFirewall({
    name: "test-firewall",
    region: "LON1",
});
Copy
import pulumi
import pulumi_civo as civo

test = civo.get_firewall(name="test-firewall",
    region="LON1")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/civo/civo"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := civo.LookupFirewall(ctx, &civo.LookupFirewallArgs{
			Name:   pulumi.StringRef("test-firewall"),
			Region: pulumi.StringRef("LON1"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Civo = Pulumi.Civo;

return await Deployment.RunAsync(() => 
{
    var test = Civo.GetFirewall.Invoke(new()
    {
        Name = "test-firewall",
        Region = "LON1",
    });

});
Copy
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("LON1")
            .build());

    }
}
Copy
variables:
  test:
    fn::invoke:
      function: civo:getFirewall
      arguments:
        name: test-firewall
        region: LON1
Copy

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>
Copy
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]
Copy
func LookupFirewall(ctx *Context, args *LookupFirewallArgs, opts ...InvokeOption) (*LookupFirewallResult, error)
func LookupFirewallOutput(ctx *Context, args *LookupFirewallOutputArgs, opts ...InvokeOption) LookupFirewallResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetFirewallResult> getFirewall(GetFirewallArgs args, InvokeOptions options)
public static Output<GetFirewallResult> getFirewall(GetFirewallArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: civo:index/getFirewall:getFirewall
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Id string
The ID of this resource.
Name string
The name of the firewall
Region string
The region where the firewall is
Id string
The ID of this resource.
Name string
The name of the firewall
Region string
The region where the firewall is
id String
The ID of this resource.
name String
The name of the firewall
region String
The region where the firewall is
id string
The ID of this resource.
name string
The name of the firewall
region string
The region where the firewall is
id str
The ID of this resource.
name str
The name of the firewall
region str
The region where the firewall is
id String
The ID of this resource.
name String
The name of the firewall
region String
The region where the firewall is

getFirewall Result

The following output properties are available:

NetworkId string
The id of the associated network
Id string
The ID of this resource.
Name string
The name of the firewall
Region string
The region where the firewall is
NetworkId string
The id of the associated network
Id string
The ID of this resource.
Name string
The name of the firewall
Region string
The region where the firewall is
networkId String
The id of the associated network
id String
The ID of this resource.
name String
The name of the firewall
region String
The region where the firewall is
networkId string
The id of the associated network
id string
The ID of this resource.
name string
The name of the firewall
region string
The region where the firewall is
network_id str
The id of the associated network
id str
The ID of this resource.
name str
The name of the firewall
region str
The region where the firewall is
networkId String
The id of the associated network
id String
The ID of this resource.
name String
The name of the firewall
region String
The region where the firewall is

Package Details

Repository
Civo civo/terraform-provider-civo
License
Notes
This Pulumi package is based on the civo Terraform Provider.
civo 1.1.5 published on Thursday, Feb 6, 2025 by civo