Viewing docs for DigitalOcean v4.61.0
published on Saturday, Mar 7, 2026 by Pulumi
published on Saturday, Mar 7, 2026 by Pulumi
Viewing docs for DigitalOcean v4.61.0
published on Saturday, Mar 7, 2026 by Pulumi
published on Saturday, Mar 7, 2026 by Pulumi
Get information on a DigitalOcean Firewall.
Example Usage
Get the firewall:
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const example = digitalocean.getFirewall({
firewallId: "1df48973-6eef-4214-854f-fa7726e7e583",
});
export const exampleFirewallName = example.then(example => example.name);
import pulumi
import pulumi_digitalocean as digitalocean
example = digitalocean.get_firewall(firewall_id="1df48973-6eef-4214-854f-fa7726e7e583")
pulumi.export("exampleFirewallName", example.name)
package main
import (
"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := digitalocean.LookupFirewall(ctx, &digitalocean.LookupFirewallArgs{
FirewallId: "1df48973-6eef-4214-854f-fa7726e7e583",
}, nil)
if err != nil {
return err
}
ctx.Export("exampleFirewallName", example.Name)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
var example = DigitalOcean.GetFirewall.Invoke(new()
{
FirewallId = "1df48973-6eef-4214-854f-fa7726e7e583",
});
return new Dictionary<string, object?>
{
["exampleFirewallName"] = example.Apply(getFirewallResult => getFirewallResult.Name),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DigitaloceanFunctions;
import com.pulumi.digitalocean.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 example = DigitaloceanFunctions.getFirewall(GetFirewallArgs.builder()
.firewallId("1df48973-6eef-4214-854f-fa7726e7e583")
.build());
ctx.export("exampleFirewallName", example.name());
}
}
variables:
example:
fn::invoke:
function: digitalocean:getFirewall
arguments:
firewallId: 1df48973-6eef-4214-854f-fa7726e7e583
outputs:
exampleFirewallName: ${example.name}
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(droplet_ids: Optional[Sequence[int]] = None,
firewall_id: Optional[str] = None,
inbound_rules: Optional[Sequence[GetFirewallInboundRule]] = None,
outbound_rules: Optional[Sequence[GetFirewallOutboundRule]] = None,
tags: Optional[Sequence[str]] = None,
opts: Optional[InvokeOptions] = None) -> GetFirewallResult
def get_firewall_output(droplet_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
firewall_id: Optional[pulumi.Input[str]] = None,
inbound_rules: Optional[pulumi.Input[Sequence[pulumi.Input[GetFirewallInboundRuleArgs]]]] = None,
outbound_rules: Optional[pulumi.Input[Sequence[pulumi.Input[GetFirewallOutboundRuleArgs]]]] = None,
tags: Optional[pulumi.Input[Sequence[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)
public static Output<GetFirewallResult> getFirewall(GetFirewallArgs args, InvokeOptions options)
fn::invoke:
function: digitalocean:index/getFirewall:getFirewall
arguments:
# arguments dictionaryThe following arguments are supported:
- Firewall
Id string - The ID of the firewall to retrieve information about.
- Droplet
Ids List<int> - The list of the IDs of the Droplets assigned to the Firewall.
- Inbound
Rules List<Pulumi.Digital Ocean. Inputs. Get Firewall Inbound Rule> - Outbound
Rules List<Pulumi.Digital Ocean. Inputs. Get Firewall Outbound Rule> - List<string>
- The names of the Tags assigned to the Firewall.
- Firewall
Id string - The ID of the firewall to retrieve information about.
- Droplet
Ids []int - The list of the IDs of the Droplets assigned to the Firewall.
- Inbound
Rules []GetFirewall Inbound Rule - Outbound
Rules []GetFirewall Outbound Rule - []string
- The names of the Tags assigned to the Firewall.
- firewall
Id String - The ID of the firewall to retrieve information about.
- droplet
Ids List<Integer> - The list of the IDs of the Droplets assigned to the Firewall.
- inbound
Rules List<GetFirewall Inbound Rule> - outbound
Rules List<GetFirewall Outbound Rule> - List<String>
- The names of the Tags assigned to the Firewall.
- firewall
Id string - The ID of the firewall to retrieve information about.
- droplet
Ids number[] - The list of the IDs of the Droplets assigned to the Firewall.
- inbound
Rules GetFirewall Inbound Rule[] - outbound
Rules GetFirewall Outbound Rule[] - string[]
- The names of the Tags assigned to the Firewall.
- firewall_
id str - The ID of the firewall to retrieve information about.
- droplet_
ids Sequence[int] - The list of the IDs of the Droplets assigned to the Firewall.
- inbound_
rules Sequence[GetFirewall Inbound Rule] - outbound_
rules Sequence[GetFirewall Outbound Rule] - Sequence[str]
- The names of the Tags assigned to the Firewall.
- firewall
Id String - The ID of the firewall to retrieve information about.
- droplet
Ids List<Number> - The list of the IDs of the Droplets assigned to the Firewall.
- inbound
Rules List<Property Map> - outbound
Rules List<Property Map> - List<String>
- The names of the Tags assigned to the Firewall.
getFirewall Result
The following output properties are available:
- Created
At string - A time value given in ISO8601 combined date and time format that represents when the Firewall was created.
- Droplet
Ids List<int> - The list of the IDs of the Droplets assigned to the Firewall.
- Firewall
Id string - Id string
- The provider-assigned unique ID for this managed resource.
- Inbound
Rules List<Pulumi.Digital Ocean. Outputs. Get Firewall Inbound Rule> - Name string
- The name of the Firewall.
- Outbound
Rules List<Pulumi.Digital Ocean. Outputs. Get Firewall Outbound Rule> - Pending
Changes List<Pulumi.Digital Ocean. Outputs. Get Firewall Pending Change> - A set of object containing the fields,
droplet_id,removing, andstatus. It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied. - Status string
- A status string indicating the current state of the Firewall. This can be "waiting", "succeeded", or "failed".
- List<string>
- The names of the Tags assigned to the Firewall.
- Created
At string - A time value given in ISO8601 combined date and time format that represents when the Firewall was created.
- Droplet
Ids []int - The list of the IDs of the Droplets assigned to the Firewall.
- Firewall
Id string - Id string
- The provider-assigned unique ID for this managed resource.
- Inbound
Rules []GetFirewall Inbound Rule - Name string
- The name of the Firewall.
- Outbound
Rules []GetFirewall Outbound Rule - Pending
Changes []GetFirewall Pending Change - A set of object containing the fields,
droplet_id,removing, andstatus. It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied. - Status string
- A status string indicating the current state of the Firewall. This can be "waiting", "succeeded", or "failed".
- []string
- The names of the Tags assigned to the Firewall.
- created
At String - A time value given in ISO8601 combined date and time format that represents when the Firewall was created.
- droplet
Ids List<Integer> - The list of the IDs of the Droplets assigned to the Firewall.
- firewall
Id String - id String
- The provider-assigned unique ID for this managed resource.
- inbound
Rules List<GetFirewall Inbound Rule> - name String
- The name of the Firewall.
- outbound
Rules List<GetFirewall Outbound Rule> - pending
Changes List<GetFirewall Pending Change> - A set of object containing the fields,
droplet_id,removing, andstatus. It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied. - status String
- A status string indicating the current state of the Firewall. This can be "waiting", "succeeded", or "failed".
- List<String>
- The names of the Tags assigned to the Firewall.
- created
At string - A time value given in ISO8601 combined date and time format that represents when the Firewall was created.
- droplet
Ids number[] - The list of the IDs of the Droplets assigned to the Firewall.
- firewall
Id string - id string
- The provider-assigned unique ID for this managed resource.
- inbound
Rules GetFirewall Inbound Rule[] - name string
- The name of the Firewall.
- outbound
Rules GetFirewall Outbound Rule[] - pending
Changes GetFirewall Pending Change[] - A set of object containing the fields,
droplet_id,removing, andstatus. It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied. - status string
- A status string indicating the current state of the Firewall. This can be "waiting", "succeeded", or "failed".
- string[]
- The names of the Tags assigned to the Firewall.
- created_
at str - A time value given in ISO8601 combined date and time format that represents when the Firewall was created.
- droplet_
ids Sequence[int] - The list of the IDs of the Droplets assigned to the Firewall.
- firewall_
id str - id str
- The provider-assigned unique ID for this managed resource.
- inbound_
rules Sequence[GetFirewall Inbound Rule] - name str
- The name of the Firewall.
- outbound_
rules Sequence[GetFirewall Outbound Rule] - pending_
changes Sequence[GetFirewall Pending Change] - A set of object containing the fields,
droplet_id,removing, andstatus. It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied. - status str
- A status string indicating the current state of the Firewall. This can be "waiting", "succeeded", or "failed".
- Sequence[str]
- The names of the Tags assigned to the Firewall.
- created
At String - A time value given in ISO8601 combined date and time format that represents when the Firewall was created.
- droplet
Ids List<Number> - The list of the IDs of the Droplets assigned to the Firewall.
- firewall
Id String - id String
- The provider-assigned unique ID for this managed resource.
- inbound
Rules List<Property Map> - name String
- The name of the Firewall.
- outbound
Rules List<Property Map> - pending
Changes List<Property Map> - A set of object containing the fields,
droplet_id,removing, andstatus. It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied. - status String
- A status string indicating the current state of the Firewall. This can be "waiting", "succeeded", or "failed".
- List<String>
- The names of the Tags assigned to the Firewall.
Supporting Types
GetFirewallInboundRule
- Protocol string
- The type of traffic to be allowed. This may be one of "tcp", "udp", or "icmp".
- Port
Range string - The ports on which traffic will be allowed
specified as a string containing a single port, a range (e.g. "8000-9000"),
or "1-65535" to open all ports for a protocol. Required for when protocol is
tcporudp. - Source
Addresses List<string> - An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs from which the inbound traffic will be accepted.
- Source
Droplet List<int>Ids - An array containing the IDs of the Droplets from which the inbound traffic will be accepted.
- Source
Kubernetes List<string>Ids - Source
Load List<string>Balancer Uids - An array containing the IDs of the Load Balancers from which the inbound traffic will be accepted.
- List<string>
- A set of names of Tags corresponding to group of Droplets from which the inbound traffic will be accepted.
- Protocol string
- The type of traffic to be allowed. This may be one of "tcp", "udp", or "icmp".
- Port
Range string - The ports on which traffic will be allowed
specified as a string containing a single port, a range (e.g. "8000-9000"),
or "1-65535" to open all ports for a protocol. Required for when protocol is
tcporudp. - Source
Addresses []string - An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs from which the inbound traffic will be accepted.
- Source
Droplet []intIds - An array containing the IDs of the Droplets from which the inbound traffic will be accepted.
- Source
Kubernetes []stringIds - Source
Load []stringBalancer Uids - An array containing the IDs of the Load Balancers from which the inbound traffic will be accepted.
- []string
- A set of names of Tags corresponding to group of Droplets from which the inbound traffic will be accepted.
- protocol String
- The type of traffic to be allowed. This may be one of "tcp", "udp", or "icmp".
- port
Range String - The ports on which traffic will be allowed
specified as a string containing a single port, a range (e.g. "8000-9000"),
or "1-65535" to open all ports for a protocol. Required for when protocol is
tcporudp. - source
Addresses List<String> - An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs from which the inbound traffic will be accepted.
- source
Droplet List<Integer>Ids - An array containing the IDs of the Droplets from which the inbound traffic will be accepted.
- source
Kubernetes List<String>Ids - source
Load List<String>Balancer Uids - An array containing the IDs of the Load Balancers from which the inbound traffic will be accepted.
- List<String>
- A set of names of Tags corresponding to group of Droplets from which the inbound traffic will be accepted.
- protocol string
- The type of traffic to be allowed. This may be one of "tcp", "udp", or "icmp".
- port
Range string - The ports on which traffic will be allowed
specified as a string containing a single port, a range (e.g. "8000-9000"),
or "1-65535" to open all ports for a protocol. Required for when protocol is
tcporudp. - source
Addresses string[] - An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs from which the inbound traffic will be accepted.
- source
Droplet number[]Ids - An array containing the IDs of the Droplets from which the inbound traffic will be accepted.
- source
Kubernetes string[]Ids - source
Load string[]Balancer Uids - An array containing the IDs of the Load Balancers from which the inbound traffic will be accepted.
- string[]
- A set of names of Tags corresponding to group of Droplets from which the inbound traffic will be accepted.
- protocol str
- The type of traffic to be allowed. This may be one of "tcp", "udp", or "icmp".
- port_
range str - The ports on which traffic will be allowed
specified as a string containing a single port, a range (e.g. "8000-9000"),
or "1-65535" to open all ports for a protocol. Required for when protocol is
tcporudp. - source_
addresses Sequence[str] - An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs from which the inbound traffic will be accepted.
- source_
droplet_ Sequence[int]ids - An array containing the IDs of the Droplets from which the inbound traffic will be accepted.
- source_
kubernetes_ Sequence[str]ids - source_
load_ Sequence[str]balancer_ uids - An array containing the IDs of the Load Balancers from which the inbound traffic will be accepted.
- Sequence[str]
- A set of names of Tags corresponding to group of Droplets from which the inbound traffic will be accepted.
- protocol String
- The type of traffic to be allowed. This may be one of "tcp", "udp", or "icmp".
- port
Range String - The ports on which traffic will be allowed
specified as a string containing a single port, a range (e.g. "8000-9000"),
or "1-65535" to open all ports for a protocol. Required for when protocol is
tcporudp. - source
Addresses List<String> - An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs from which the inbound traffic will be accepted.
- source
Droplet List<Number>Ids - An array containing the IDs of the Droplets from which the inbound traffic will be accepted.
- source
Kubernetes List<String>Ids - source
Load List<String>Balancer Uids - An array containing the IDs of the Load Balancers from which the inbound traffic will be accepted.
- List<String>
- A set of names of Tags corresponding to group of Droplets from which the inbound traffic will be accepted.
GetFirewallOutboundRule
- Protocol string
- The type of traffic to be allowed. This may be one of "tcp", "udp", or "icmp".
- Destination
Addresses List<string> - An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the outbound traffic will be allowed.
- Destination
Droplet List<int>Ids - An array containing the IDs of the Droplets to which the outbound traffic will be allowed.
- Destination
Kubernetes List<string>Ids - Destination
Load List<string>Balancer Uids - An array containing the IDs of the Load Balancers to which the outbound traffic will be allowed.
- List<string>
- An array containing the names of Tags corresponding to groups of Droplets to which the outbound traffic will be allowed. traffic.
- Port
Range string - The ports on which traffic will be allowed
specified as a string containing a single port, a range (e.g. "8000-9000"),
or "1-65535" to open all ports for a protocol. Required for when protocol is
tcporudp.
- Protocol string
- The type of traffic to be allowed. This may be one of "tcp", "udp", or "icmp".
- Destination
Addresses []string - An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the outbound traffic will be allowed.
- Destination
Droplet []intIds - An array containing the IDs of the Droplets to which the outbound traffic will be allowed.
- Destination
Kubernetes []stringIds - Destination
Load []stringBalancer Uids - An array containing the IDs of the Load Balancers to which the outbound traffic will be allowed.
- []string
- An array containing the names of Tags corresponding to groups of Droplets to which the outbound traffic will be allowed. traffic.
- Port
Range string - The ports on which traffic will be allowed
specified as a string containing a single port, a range (e.g. "8000-9000"),
or "1-65535" to open all ports for a protocol. Required for when protocol is
tcporudp.
- protocol String
- The type of traffic to be allowed. This may be one of "tcp", "udp", or "icmp".
- destination
Addresses List<String> - An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the outbound traffic will be allowed.
- destination
Droplet List<Integer>Ids - An array containing the IDs of the Droplets to which the outbound traffic will be allowed.
- destination
Kubernetes List<String>Ids - destination
Load List<String>Balancer Uids - An array containing the IDs of the Load Balancers to which the outbound traffic will be allowed.
- List<String>
- An array containing the names of Tags corresponding to groups of Droplets to which the outbound traffic will be allowed. traffic.
- port
Range String - The ports on which traffic will be allowed
specified as a string containing a single port, a range (e.g. "8000-9000"),
or "1-65535" to open all ports for a protocol. Required for when protocol is
tcporudp.
- protocol string
- The type of traffic to be allowed. This may be one of "tcp", "udp", or "icmp".
- destination
Addresses string[] - An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the outbound traffic will be allowed.
- destination
Droplet number[]Ids - An array containing the IDs of the Droplets to which the outbound traffic will be allowed.
- destination
Kubernetes string[]Ids - destination
Load string[]Balancer Uids - An array containing the IDs of the Load Balancers to which the outbound traffic will be allowed.
- string[]
- An array containing the names of Tags corresponding to groups of Droplets to which the outbound traffic will be allowed. traffic.
- port
Range string - The ports on which traffic will be allowed
specified as a string containing a single port, a range (e.g. "8000-9000"),
or "1-65535" to open all ports for a protocol. Required for when protocol is
tcporudp.
- protocol str
- The type of traffic to be allowed. This may be one of "tcp", "udp", or "icmp".
- destination_
addresses Sequence[str] - An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the outbound traffic will be allowed.
- destination_
droplet_ Sequence[int]ids - An array containing the IDs of the Droplets to which the outbound traffic will be allowed.
- destination_
kubernetes_ Sequence[str]ids - destination_
load_ Sequence[str]balancer_ uids - An array containing the IDs of the Load Balancers to which the outbound traffic will be allowed.
- Sequence[str]
- An array containing the names of Tags corresponding to groups of Droplets to which the outbound traffic will be allowed. traffic.
- port_
range str - The ports on which traffic will be allowed
specified as a string containing a single port, a range (e.g. "8000-9000"),
or "1-65535" to open all ports for a protocol. Required for when protocol is
tcporudp.
- protocol String
- The type of traffic to be allowed. This may be one of "tcp", "udp", or "icmp".
- destination
Addresses List<String> - An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the outbound traffic will be allowed.
- destination
Droplet List<Number>Ids - An array containing the IDs of the Droplets to which the outbound traffic will be allowed.
- destination
Kubernetes List<String>Ids - destination
Load List<String>Balancer Uids - An array containing the IDs of the Load Balancers to which the outbound traffic will be allowed.
- List<String>
- An array containing the names of Tags corresponding to groups of Droplets to which the outbound traffic will be allowed. traffic.
- port
Range String - The ports on which traffic will be allowed
specified as a string containing a single port, a range (e.g. "8000-9000"),
or "1-65535" to open all ports for a protocol. Required for when protocol is
tcporudp.
GetFirewallPendingChange
- droplet_
id int - removing bool
- status str
- A status string indicating the current state of the Firewall. This can be "waiting", "succeeded", or "failed".
Package Details
- Repository
- DigitalOcean pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitaloceanTerraform Provider.
Viewing docs for DigitalOcean v4.61.0
published on Saturday, Mar 7, 2026 by Pulumi
published on Saturday, Mar 7, 2026 by Pulumi
