ionoscloud.getFirewall
Explore with Pulumi AI
The Firewall data source can be used to search for and return an existing FirewallRules. You can provide a string for either id or name parameters which will be compared with provisioned Firewall Rules. If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned. When this happens, please refine your search string so that it is specific enough to return only one result.
Example Usage
By ID
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.getFirewall({
datacenterId: "datacenter_id",
id: "firewall_id",
nicId: "nic_id",
serverId: "server_id",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_firewall(datacenter_id="datacenter_id",
id="firewall_id",
nic_id="nic_id",
server_id="server_id")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ionoscloud.LookupFirewall(ctx, &ionoscloud.LookupFirewallArgs{
DatacenterId: "datacenter_id",
Id: pulumi.StringRef("firewall_id"),
NicId: "nic_id",
ServerId: "server_id",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.GetFirewall.Invoke(new()
{
DatacenterId = "datacenter_id",
Id = "firewall_id",
NicId = "nic_id",
ServerId = "server_id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.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 = IonoscloudFunctions.getFirewall(GetFirewallArgs.builder()
.datacenterId("datacenter_id")
.id("firewall_id")
.nicId("nic_id")
.serverId("server_id")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getFirewall
arguments:
datacenterId: datacenter_id
id: firewall_id
nicId: nic_id
serverId: server_id
By Name
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.getFirewall({
datacenterId: "datacenter_id",
name: "test_ds_firewall_rule",
nicId: "nic_id",
serverId: "server_id",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_firewall(datacenter_id="datacenter_id",
name="test_ds_firewall_rule",
nic_id="nic_id",
server_id="server_id")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ionoscloud.LookupFirewall(ctx, &ionoscloud.LookupFirewallArgs{
DatacenterId: "datacenter_id",
Name: pulumi.StringRef("test_ds_firewall_rule"),
NicId: "nic_id",
ServerId: "server_id",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.GetFirewall.Invoke(new()
{
DatacenterId = "datacenter_id",
Name = "test_ds_firewall_rule",
NicId = "nic_id",
ServerId = "server_id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.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 = IonoscloudFunctions.getFirewall(GetFirewallArgs.builder()
.datacenterId("datacenter_id")
.name("test_ds_firewall_rule")
.nicId("nic_id")
.serverId("server_id")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getFirewall
arguments:
datacenterId: datacenter_id
name: test_ds_firewall_rule
nicId: nic_id
serverId: server_id
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(datacenter_id: Optional[str] = None,
id: Optional[str] = None,
name: Optional[str] = None,
nic_id: Optional[str] = None,
server_id: Optional[str] = None,
timeouts: Optional[GetFirewallTimeouts] = None,
opts: Optional[InvokeOptions] = None) -> GetFirewallResult
def get_firewall_output(datacenter_id: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
nic_id: Optional[pulumi.Input[str]] = None,
server_id: Optional[pulumi.Input[str]] = None,
timeouts: Optional[pulumi.Input[GetFirewallTimeoutsArgs]] = 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: ionoscloud:index/getFirewall:getFirewall
arguments:
# arguments dictionary
The following arguments are supported:
- Datacenter
Id string - The Virtual Data Center ID.
- Nic
Id string The NIC ID.
Either
name
orid
must be provided. If none, or both are provided, the datasource will return an error.- Server
Id string - The Server ID.
- Id string
- ID of the firewall rule you want to search for.
- Name string
- Name of an existing firewall rule that you want to search for.
- Timeouts
Get
Firewall Timeouts
- Datacenter
Id string - The Virtual Data Center ID.
- Nic
Id string The NIC ID.
Either
name
orid
must be provided. If none, or both are provided, the datasource will return an error.- Server
Id string - The Server ID.
- Id string
- ID of the firewall rule you want to search for.
- Name string
- Name of an existing firewall rule that you want to search for.
- Timeouts
Get
Firewall Timeouts
- datacenter
Id String - The Virtual Data Center ID.
- nic
Id String The NIC ID.
Either
name
orid
must be provided. If none, or both are provided, the datasource will return an error.- server
Id String - The Server ID.
- id String
- ID of the firewall rule you want to search for.
- name String
- Name of an existing firewall rule that you want to search for.
- timeouts
Get
Firewall Timeouts
- datacenter
Id string - The Virtual Data Center ID.
- nic
Id string The NIC ID.
Either
name
orid
must be provided. If none, or both are provided, the datasource will return an error.- server
Id string - The Server ID.
- id string
- ID of the firewall rule you want to search for.
- name string
- Name of an existing firewall rule that you want to search for.
- timeouts
Get
Firewall Timeouts
- datacenter_
id str - The Virtual Data Center ID.
- nic_
id str The NIC ID.
Either
name
orid
must be provided. If none, or both are provided, the datasource will return an error.- server_
id str - The Server ID.
- id str
- ID of the firewall rule you want to search for.
- name str
- Name of an existing firewall rule that you want to search for.
- timeouts
Get
Firewall Timeouts
- datacenter
Id String - The Virtual Data Center ID.
- nic
Id String The NIC ID.
Either
name
orid
must be provided. If none, or both are provided, the datasource will return an error.- server
Id String - The Server ID.
- id String
- ID of the firewall rule you want to search for.
- name String
- Name of an existing firewall rule that you want to search for.
- timeouts Property Map
getFirewall Result
The following output properties are available:
- Datacenter
Id string - Icmp
Code string - Defines the allowed code (from 0 to 254) if protocol ICMP is chosen.
- Icmp
Type string - Defines the allowed type (from 0 to 254) if the protocol ICMP is chosen.
- Id string
- The id of the firewall rule.
- Name string
- The name of the firewall rule.
- Nic
Id string - Port
Range doubleEnd - Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen.
- Port
Range doubleStart - Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen.
- Protocol string
- The protocol for the rule: TCP, UDP, ICMP, ANY. This property is immutable.
- Server
Id string - Source
Ip string - Only traffic originating from the respective IPv4 address is allowed.
- Source
Mac string - Only traffic originating from the respective MAC address is allowed.
- Target
Ip string - Only traffic directed to the respective IP address of the NIC is allowed.
- Type string
- Timeouts
Get
Firewall Timeouts
- Datacenter
Id string - Icmp
Code string - Defines the allowed code (from 0 to 254) if protocol ICMP is chosen.
- Icmp
Type string - Defines the allowed type (from 0 to 254) if the protocol ICMP is chosen.
- Id string
- The id of the firewall rule.
- Name string
- The name of the firewall rule.
- Nic
Id string - Port
Range float64End - Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen.
- Port
Range float64Start - Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen.
- Protocol string
- The protocol for the rule: TCP, UDP, ICMP, ANY. This property is immutable.
- Server
Id string - Source
Ip string - Only traffic originating from the respective IPv4 address is allowed.
- Source
Mac string - Only traffic originating from the respective MAC address is allowed.
- Target
Ip string - Only traffic directed to the respective IP address of the NIC is allowed.
- Type string
- Timeouts
Get
Firewall Timeouts
- datacenter
Id String - icmp
Code String - Defines the allowed code (from 0 to 254) if protocol ICMP is chosen.
- icmp
Type String - Defines the allowed type (from 0 to 254) if the protocol ICMP is chosen.
- id String
- The id of the firewall rule.
- name String
- The name of the firewall rule.
- nic
Id String - port
Range DoubleEnd - Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen.
- port
Range DoubleStart - Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen.
- protocol String
- The protocol for the rule: TCP, UDP, ICMP, ANY. This property is immutable.
- server
Id String - source
Ip String - Only traffic originating from the respective IPv4 address is allowed.
- source
Mac String - Only traffic originating from the respective MAC address is allowed.
- target
Ip String - Only traffic directed to the respective IP address of the NIC is allowed.
- type String
- timeouts
Get
Firewall Timeouts
- datacenter
Id string - icmp
Code string - Defines the allowed code (from 0 to 254) if protocol ICMP is chosen.
- icmp
Type string - Defines the allowed type (from 0 to 254) if the protocol ICMP is chosen.
- id string
- The id of the firewall rule.
- name string
- The name of the firewall rule.
- nic
Id string - port
Range numberEnd - Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen.
- port
Range numberStart - Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen.
- protocol string
- The protocol for the rule: TCP, UDP, ICMP, ANY. This property is immutable.
- server
Id string - source
Ip string - Only traffic originating from the respective IPv4 address is allowed.
- source
Mac string - Only traffic originating from the respective MAC address is allowed.
- target
Ip string - Only traffic directed to the respective IP address of the NIC is allowed.
- type string
- timeouts
Get
Firewall Timeouts
- datacenter_
id str - icmp_
code str - Defines the allowed code (from 0 to 254) if protocol ICMP is chosen.
- icmp_
type str - Defines the allowed type (from 0 to 254) if the protocol ICMP is chosen.
- id str
- The id of the firewall rule.
- name str
- The name of the firewall rule.
- nic_
id str - port_
range_ floatend - Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen.
- port_
range_ floatstart - Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen.
- protocol str
- The protocol for the rule: TCP, UDP, ICMP, ANY. This property is immutable.
- server_
id str - source_
ip str - Only traffic originating from the respective IPv4 address is allowed.
- source_
mac str - Only traffic originating from the respective MAC address is allowed.
- target_
ip str - Only traffic directed to the respective IP address of the NIC is allowed.
- type str
- timeouts
Get
Firewall Timeouts
- datacenter
Id String - icmp
Code String - Defines the allowed code (from 0 to 254) if protocol ICMP is chosen.
- icmp
Type String - Defines the allowed type (from 0 to 254) if the protocol ICMP is chosen.
- id String
- The id of the firewall rule.
- name String
- The name of the firewall rule.
- nic
Id String - port
Range NumberEnd - Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen.
- port
Range NumberStart - Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen.
- protocol String
- The protocol for the rule: TCP, UDP, ICMP, ANY. This property is immutable.
- server
Id String - source
Ip String - Only traffic originating from the respective IPv4 address is allowed.
- source
Mac String - Only traffic originating from the respective MAC address is allowed.
- target
Ip String - Only traffic directed to the respective IP address of the NIC is allowed.
- type String
- timeouts Property Map
Supporting Types
GetFirewallTimeouts
Package Details
- Repository
- ionoscloud ionos-cloud/terraform-provider-ionoscloud
- License
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.