ionoscloud.Firewall
Explore with Pulumi AI
Manages a set of Firewall Rules on IonosCloud.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
import * as random from "@pulumi/random";
const exampleDatacenter = new ionoscloud.Datacenter("exampleDatacenter", {
location: "us/las",
description: "Datacenter Description",
secAuthProtection: false,
});
const exampleIpblock = new ionoscloud.Ipblock("exampleIpblock", {
location: exampleDatacenter.location,
size: 2,
});
const serverImagePassword = new random.index.Random_password("serverImagePassword", {
length: 16,
special: false,
});
const exampleServer = new ionoscloud.Server("exampleServer", {
datacenterId: exampleDatacenter.datacenterId,
cores: 1,
ram: 1024,
imageName: "Ubuntu-20.04",
imagePassword: serverImagePassword.result,
volume: {
name: "system",
size: 14,
diskType: "SSD",
},
nic: {
lan: 1,
dhcp: true,
firewallActive: true,
},
});
const exampleNic = new ionoscloud.Nic("exampleNic", {
datacenterId: exampleDatacenter.datacenterId,
serverId: exampleServer.serverId,
lan: 2,
dhcp: true,
firewallActive: true,
});
const exampleFirewall = new ionoscloud.Firewall("exampleFirewall", {
datacenterId: exampleDatacenter.datacenterId,
serverId: exampleServer.serverId,
nicId: exampleNic.nicId,
protocol: "ICMP",
sourceMac: "00:0a:95:9d:68:16",
sourceIp: exampleIpblock.ips[0],
targetIp: exampleIpblock.ips[1],
icmpType: "1",
icmpCode: "8",
type: "INGRESS",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
import pulumi_random as random
example_datacenter = ionoscloud.Datacenter("exampleDatacenter",
location="us/las",
description="Datacenter Description",
sec_auth_protection=False)
example_ipblock = ionoscloud.Ipblock("exampleIpblock",
location=example_datacenter.location,
size=2)
server_image_password = random.index.Random_password("serverImagePassword",
length=16,
special=False)
example_server = ionoscloud.Server("exampleServer",
datacenter_id=example_datacenter.datacenter_id,
cores=1,
ram=1024,
image_name="Ubuntu-20.04",
image_password=server_image_password["result"],
volume={
"name": "system",
"size": 14,
"disk_type": "SSD",
},
nic={
"lan": 1,
"dhcp": True,
"firewall_active": True,
})
example_nic = ionoscloud.Nic("exampleNic",
datacenter_id=example_datacenter.datacenter_id,
server_id=example_server.server_id,
lan=2,
dhcp=True,
firewall_active=True)
example_firewall = ionoscloud.Firewall("exampleFirewall",
datacenter_id=example_datacenter.datacenter_id,
server_id=example_server.server_id,
nic_id=example_nic.nic_id,
protocol="ICMP",
source_mac="00:0a:95:9d:68:16",
source_ip=example_ipblock.ips[0],
target_ip=example_ipblock.ips[1],
icmp_type="1",
icmp_code="8",
type="INGRESS")
package main
import (
"github.com/pulumi/pulumi-random/sdk/go/random"
"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 {
exampleDatacenter, err := ionoscloud.NewDatacenter(ctx, "exampleDatacenter", &ionoscloud.DatacenterArgs{
Location: pulumi.String("us/las"),
Description: pulumi.String("Datacenter Description"),
SecAuthProtection: pulumi.Bool(false),
})
if err != nil {
return err
}
exampleIpblock, err := ionoscloud.NewIpblock(ctx, "exampleIpblock", &ionoscloud.IpblockArgs{
Location: exampleDatacenter.Location,
Size: pulumi.Float64(2),
})
if err != nil {
return err
}
serverImagePassword, err := random.NewRandom_password(ctx, "serverImagePassword", &random.Random_passwordArgs{
Length: 16,
Special: false,
})
if err != nil {
return err
}
exampleServer, err := ionoscloud.NewServer(ctx, "exampleServer", &ionoscloud.ServerArgs{
DatacenterId: exampleDatacenter.DatacenterId,
Cores: pulumi.Float64(1),
Ram: pulumi.Float64(1024),
ImageName: pulumi.String("Ubuntu-20.04"),
ImagePassword: serverImagePassword.Result,
Volume: &ionoscloud.ServerVolumeArgs{
Name: pulumi.String("system"),
Size: pulumi.Float64(14),
DiskType: pulumi.String("SSD"),
},
Nic: &ionoscloud.ServerNicArgs{
Lan: pulumi.Float64(1),
Dhcp: pulumi.Bool(true),
FirewallActive: pulumi.Bool(true),
},
})
if err != nil {
return err
}
exampleNic, err := ionoscloud.NewNic(ctx, "exampleNic", &ionoscloud.NicArgs{
DatacenterId: exampleDatacenter.DatacenterId,
ServerId: exampleServer.ServerId,
Lan: pulumi.Float64(2),
Dhcp: pulumi.Bool(true),
FirewallActive: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = ionoscloud.NewFirewall(ctx, "exampleFirewall", &ionoscloud.FirewallArgs{
DatacenterId: exampleDatacenter.DatacenterId,
ServerId: exampleServer.ServerId,
NicId: exampleNic.NicId,
Protocol: pulumi.String("ICMP"),
SourceMac: pulumi.String("00:0a:95:9d:68:16"),
SourceIp: exampleIpblock.Ips.ApplyT(func(ips []string) (string, error) {
return ips[0], nil
}).(pulumi.StringOutput),
TargetIp: exampleIpblock.Ips.ApplyT(func(ips []string) (string, error) {
return ips[1], nil
}).(pulumi.StringOutput),
IcmpType: pulumi.String("1"),
IcmpCode: pulumi.String("8"),
Type: pulumi.String("INGRESS"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var exampleDatacenter = new Ionoscloud.Datacenter("exampleDatacenter", new()
{
Location = "us/las",
Description = "Datacenter Description",
SecAuthProtection = false,
});
var exampleIpblock = new Ionoscloud.Ipblock("exampleIpblock", new()
{
Location = exampleDatacenter.Location,
Size = 2,
});
var serverImagePassword = new Random.Index.Random_password("serverImagePassword", new()
{
Length = 16,
Special = false,
});
var exampleServer = new Ionoscloud.Server("exampleServer", new()
{
DatacenterId = exampleDatacenter.DatacenterId,
Cores = 1,
Ram = 1024,
ImageName = "Ubuntu-20.04",
ImagePassword = serverImagePassword.Result,
Volume = new Ionoscloud.Inputs.ServerVolumeArgs
{
Name = "system",
Size = 14,
DiskType = "SSD",
},
Nic = new Ionoscloud.Inputs.ServerNicArgs
{
Lan = 1,
Dhcp = true,
FirewallActive = true,
},
});
var exampleNic = new Ionoscloud.Nic("exampleNic", new()
{
DatacenterId = exampleDatacenter.DatacenterId,
ServerId = exampleServer.ServerId,
Lan = 2,
Dhcp = true,
FirewallActive = true,
});
var exampleFirewall = new Ionoscloud.Firewall("exampleFirewall", new()
{
DatacenterId = exampleDatacenter.DatacenterId,
ServerId = exampleServer.ServerId,
NicId = exampleNic.NicId,
Protocol = "ICMP",
SourceMac = "00:0a:95:9d:68:16",
SourceIp = exampleIpblock.Ips.Apply(ips => ips[0]),
TargetIp = exampleIpblock.Ips.Apply(ips => ips[1]),
IcmpType = "1",
IcmpCode = "8",
Type = "INGRESS",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.Datacenter;
import com.pulumi.ionoscloud.DatacenterArgs;
import com.pulumi.ionoscloud.Ipblock;
import com.pulumi.ionoscloud.IpblockArgs;
import com.pulumi.random.random_password;
import com.pulumi.random.Random_passwordArgs;
import com.pulumi.ionoscloud.Server;
import com.pulumi.ionoscloud.ServerArgs;
import com.pulumi.ionoscloud.inputs.ServerVolumeArgs;
import com.pulumi.ionoscloud.inputs.ServerNicArgs;
import com.pulumi.ionoscloud.Nic;
import com.pulumi.ionoscloud.NicArgs;
import com.pulumi.ionoscloud.Firewall;
import com.pulumi.ionoscloud.FirewallArgs;
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) {
var exampleDatacenter = new Datacenter("exampleDatacenter", DatacenterArgs.builder()
.location("us/las")
.description("Datacenter Description")
.secAuthProtection(false)
.build());
var exampleIpblock = new Ipblock("exampleIpblock", IpblockArgs.builder()
.location(exampleDatacenter.location())
.size(2)
.build());
var serverImagePassword = new Random_password("serverImagePassword", Random_passwordArgs.builder()
.length(16)
.special(false)
.build());
var exampleServer = new Server("exampleServer", ServerArgs.builder()
.datacenterId(exampleDatacenter.datacenterId())
.cores(1)
.ram(1024)
.imageName("Ubuntu-20.04")
.imagePassword(serverImagePassword.result())
.volume(ServerVolumeArgs.builder()
.name("system")
.size(14)
.diskType("SSD")
.build())
.nic(ServerNicArgs.builder()
.lan("1")
.dhcp(true)
.firewallActive(true)
.build())
.build());
var exampleNic = new Nic("exampleNic", NicArgs.builder()
.datacenterId(exampleDatacenter.datacenterId())
.serverId(exampleServer.serverId())
.lan(2)
.dhcp(true)
.firewallActive(true)
.build());
var exampleFirewall = new Firewall("exampleFirewall", FirewallArgs.builder()
.datacenterId(exampleDatacenter.datacenterId())
.serverId(exampleServer.serverId())
.nicId(exampleNic.nicId())
.protocol("ICMP")
.sourceMac("00:0a:95:9d:68:16")
.sourceIp(exampleIpblock.ips().applyValue(ips -> ips[0]))
.targetIp(exampleIpblock.ips().applyValue(ips -> ips[1]))
.icmpType(1)
.icmpCode(8)
.type("INGRESS")
.build());
}
}
resources:
exampleDatacenter:
type: ionoscloud:Datacenter
properties:
location: us/las
description: Datacenter Description
secAuthProtection: false
exampleIpblock:
type: ionoscloud:Ipblock
properties:
location: ${exampleDatacenter.location}
size: 2
exampleServer:
type: ionoscloud:Server
properties:
datacenterId: ${exampleDatacenter.datacenterId}
cores: 1
ram: 1024
imageName: Ubuntu-20.04
imagePassword: ${serverImagePassword.result}
volume:
name: system
size: 14
diskType: SSD
nic:
lan: '1'
dhcp: true
firewallActive: true
exampleNic:
type: ionoscloud:Nic
properties:
datacenterId: ${exampleDatacenter.datacenterId}
serverId: ${exampleServer.serverId}
lan: 2
dhcp: true
firewallActive: true
exampleFirewall:
type: ionoscloud:Firewall
properties:
datacenterId: ${exampleDatacenter.datacenterId}
serverId: ${exampleServer.serverId}
nicId: ${exampleNic.nicId}
protocol: ICMP
sourceMac: 00:0a:95:9d:68:16
sourceIp: ${exampleIpblock.ips[0]}
targetIp: ${exampleIpblock.ips[1]}
icmpType: 1
icmpCode: 8
type: INGRESS
serverImagePassword:
type: random:random_password
properties:
length: 16
special: false
Create Firewall Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Firewall(name: string, args: FirewallArgs, opts?: CustomResourceOptions);
@overload
def Firewall(resource_name: str,
args: FirewallArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Firewall(resource_name: str,
opts: Optional[ResourceOptions] = None,
nic_id: Optional[str] = None,
server_id: Optional[str] = None,
protocol: Optional[str] = None,
datacenter_id: Optional[str] = None,
icmp_type: Optional[str] = None,
name: Optional[str] = None,
port_range_end: Optional[float] = None,
port_range_start: Optional[float] = None,
icmp_code: Optional[str] = None,
firewall_id: Optional[str] = None,
source_ip: Optional[str] = None,
source_mac: Optional[str] = None,
target_ip: Optional[str] = None,
timeouts: Optional[FirewallTimeoutsArgs] = None,
type: Optional[str] = None)
func NewFirewall(ctx *Context, name string, args FirewallArgs, opts ...ResourceOption) (*Firewall, error)
public Firewall(string name, FirewallArgs args, CustomResourceOptions? opts = null)
public Firewall(String name, FirewallArgs args)
public Firewall(String name, FirewallArgs args, CustomResourceOptions options)
type: ionoscloud:Firewall
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args FirewallArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args FirewallArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args FirewallArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FirewallArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FirewallArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var firewallResource = new Ionoscloud.Firewall("firewallResource", new()
{
NicId = "string",
ServerId = "string",
Protocol = "string",
DatacenterId = "string",
IcmpType = "string",
Name = "string",
PortRangeEnd = 0,
PortRangeStart = 0,
IcmpCode = "string",
FirewallId = "string",
SourceIp = "string",
SourceMac = "string",
TargetIp = "string",
Timeouts = new Ionoscloud.Inputs.FirewallTimeoutsArgs
{
Create = "string",
Default = "string",
Delete = "string",
Update = "string",
},
Type = "string",
});
example, err := ionoscloud.NewFirewall(ctx, "firewallResource", &ionoscloud.FirewallArgs{
NicId: pulumi.String("string"),
ServerId: pulumi.String("string"),
Protocol: pulumi.String("string"),
DatacenterId: pulumi.String("string"),
IcmpType: pulumi.String("string"),
Name: pulumi.String("string"),
PortRangeEnd: pulumi.Float64(0),
PortRangeStart: pulumi.Float64(0),
IcmpCode: pulumi.String("string"),
FirewallId: pulumi.String("string"),
SourceIp: pulumi.String("string"),
SourceMac: pulumi.String("string"),
TargetIp: pulumi.String("string"),
Timeouts: &ionoscloud.FirewallTimeoutsArgs{
Create: pulumi.String("string"),
Default: pulumi.String("string"),
Delete: pulumi.String("string"),
Update: pulumi.String("string"),
},
Type: pulumi.String("string"),
})
var firewallResource = new Firewall("firewallResource", FirewallArgs.builder()
.nicId("string")
.serverId("string")
.protocol("string")
.datacenterId("string")
.icmpType("string")
.name("string")
.portRangeEnd(0)
.portRangeStart(0)
.icmpCode("string")
.firewallId("string")
.sourceIp("string")
.sourceMac("string")
.targetIp("string")
.timeouts(FirewallTimeoutsArgs.builder()
.create("string")
.default_("string")
.delete("string")
.update("string")
.build())
.type("string")
.build());
firewall_resource = ionoscloud.Firewall("firewallResource",
nic_id="string",
server_id="string",
protocol="string",
datacenter_id="string",
icmp_type="string",
name="string",
port_range_end=0,
port_range_start=0,
icmp_code="string",
firewall_id="string",
source_ip="string",
source_mac="string",
target_ip="string",
timeouts={
"create": "string",
"default": "string",
"delete": "string",
"update": "string",
},
type="string")
const firewallResource = new ionoscloud.Firewall("firewallResource", {
nicId: "string",
serverId: "string",
protocol: "string",
datacenterId: "string",
icmpType: "string",
name: "string",
portRangeEnd: 0,
portRangeStart: 0,
icmpCode: "string",
firewallId: "string",
sourceIp: "string",
sourceMac: "string",
targetIp: "string",
timeouts: {
create: "string",
"default": "string",
"delete": "string",
update: "string",
},
type: "string",
});
type: ionoscloud:Firewall
properties:
datacenterId: string
firewallId: string
icmpCode: string
icmpType: string
name: string
nicId: string
portRangeEnd: 0
portRangeStart: 0
protocol: string
serverId: string
sourceIp: string
sourceMac: string
targetIp: string
timeouts:
create: string
default: string
delete: string
update: string
type: string
Firewall Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Firewall resource accepts the following input properties:
- Datacenter
Id string - [string] The Virtual Data Center ID.
- Nic
Id string - [string] The NIC ID.
- Protocol string
- [string] The protocol for the rule: TCP, UDP, ICMP, ANY. Property cannot be modified after creation (disallowed in update requests).
- Server
Id string - [string] The Server ID.
- Firewall
Id string - Icmp
Code string - [int] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen.
- Icmp
Type string - [string] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen. Value null allows all codes.
- Name string
- [string] The name of the firewall rule.
- Port
Range doubleEnd - [int] Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- Port
Range doubleStart - [int] Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- Source
Ip string - [string] Only traffic originating from the respective IPv4 address is allowed. Value null allows all source IPs.
- Source
Mac string - [string] Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Value null allows all source MAC address. Valid format: aa:bb:cc:dd:ee:ff.
- Target
Ip string - [string] In case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. Value null allows all target IPs.
- Timeouts
Firewall
Timeouts - Type string
- [string] The type of firewall rule. If is not specified, it will take the default value INGRESS.
- Datacenter
Id string - [string] The Virtual Data Center ID.
- Nic
Id string - [string] The NIC ID.
- Protocol string
- [string] The protocol for the rule: TCP, UDP, ICMP, ANY. Property cannot be modified after creation (disallowed in update requests).
- Server
Id string - [string] The Server ID.
- Firewall
Id string - Icmp
Code string - [int] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen.
- Icmp
Type string - [string] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen. Value null allows all codes.
- Name string
- [string] The name of the firewall rule.
- Port
Range float64End - [int] Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- Port
Range float64Start - [int] Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- Source
Ip string - [string] Only traffic originating from the respective IPv4 address is allowed. Value null allows all source IPs.
- Source
Mac string - [string] Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Value null allows all source MAC address. Valid format: aa:bb:cc:dd:ee:ff.
- Target
Ip string - [string] In case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. Value null allows all target IPs.
- Timeouts
Firewall
Timeouts Args - Type string
- [string] The type of firewall rule. If is not specified, it will take the default value INGRESS.
- datacenter
Id String - [string] The Virtual Data Center ID.
- nic
Id String - [string] The NIC ID.
- protocol String
- [string] The protocol for the rule: TCP, UDP, ICMP, ANY. Property cannot be modified after creation (disallowed in update requests).
- server
Id String - [string] The Server ID.
- firewall
Id String - icmp
Code String - [int] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen.
- icmp
Type String - [string] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen. Value null allows all codes.
- name String
- [string] The name of the firewall rule.
- port
Range DoubleEnd - [int] Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- port
Range DoubleStart - [int] Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- source
Ip String - [string] Only traffic originating from the respective IPv4 address is allowed. Value null allows all source IPs.
- source
Mac String - [string] Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Value null allows all source MAC address. Valid format: aa:bb:cc:dd:ee:ff.
- target
Ip String - [string] In case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. Value null allows all target IPs.
- timeouts
Firewall
Timeouts - type String
- [string] The type of firewall rule. If is not specified, it will take the default value INGRESS.
- datacenter
Id string - [string] The Virtual Data Center ID.
- nic
Id string - [string] The NIC ID.
- protocol string
- [string] The protocol for the rule: TCP, UDP, ICMP, ANY. Property cannot be modified after creation (disallowed in update requests).
- server
Id string - [string] The Server ID.
- firewall
Id string - icmp
Code string - [int] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen.
- icmp
Type string - [string] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen. Value null allows all codes.
- name string
- [string] The name of the firewall rule.
- port
Range numberEnd - [int] Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- port
Range numberStart - [int] Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- source
Ip string - [string] Only traffic originating from the respective IPv4 address is allowed. Value null allows all source IPs.
- source
Mac string - [string] Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Value null allows all source MAC address. Valid format: aa:bb:cc:dd:ee:ff.
- target
Ip string - [string] In case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. Value null allows all target IPs.
- timeouts
Firewall
Timeouts - type string
- [string] The type of firewall rule. If is not specified, it will take the default value INGRESS.
- datacenter_
id str - [string] The Virtual Data Center ID.
- nic_
id str - [string] The NIC ID.
- protocol str
- [string] The protocol for the rule: TCP, UDP, ICMP, ANY. Property cannot be modified after creation (disallowed in update requests).
- server_
id str - [string] The Server ID.
- firewall_
id str - icmp_
code str - [int] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen.
- icmp_
type str - [string] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen. Value null allows all codes.
- name str
- [string] The name of the firewall rule.
- port_
range_ floatend - [int] Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- port_
range_ floatstart - [int] Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- source_
ip str - [string] Only traffic originating from the respective IPv4 address is allowed. Value null allows all source IPs.
- source_
mac str - [string] Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Value null allows all source MAC address. Valid format: aa:bb:cc:dd:ee:ff.
- target_
ip str - [string] In case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. Value null allows all target IPs.
- timeouts
Firewall
Timeouts Args - type str
- [string] The type of firewall rule. If is not specified, it will take the default value INGRESS.
- datacenter
Id String - [string] The Virtual Data Center ID.
- nic
Id String - [string] The NIC ID.
- protocol String
- [string] The protocol for the rule: TCP, UDP, ICMP, ANY. Property cannot be modified after creation (disallowed in update requests).
- server
Id String - [string] The Server ID.
- firewall
Id String - icmp
Code String - [int] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen.
- icmp
Type String - [string] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen. Value null allows all codes.
- name String
- [string] The name of the firewall rule.
- port
Range NumberEnd - [int] Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- port
Range NumberStart - [int] Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- source
Ip String - [string] Only traffic originating from the respective IPv4 address is allowed. Value null allows all source IPs.
- source
Mac String - [string] Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Value null allows all source MAC address. Valid format: aa:bb:cc:dd:ee:ff.
- target
Ip String - [string] In case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. Value null allows all target IPs.
- timeouts Property Map
- type String
- [string] The type of firewall rule. If is not specified, it will take the default value INGRESS.
Outputs
All input properties are implicitly available as output properties. Additionally, the Firewall resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Firewall Resource
Get an existing Firewall resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: FirewallState, opts?: CustomResourceOptions): Firewall
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
datacenter_id: Optional[str] = None,
firewall_id: Optional[str] = None,
icmp_code: Optional[str] = None,
icmp_type: Optional[str] = None,
name: Optional[str] = None,
nic_id: Optional[str] = None,
port_range_end: Optional[float] = None,
port_range_start: Optional[float] = None,
protocol: Optional[str] = None,
server_id: Optional[str] = None,
source_ip: Optional[str] = None,
source_mac: Optional[str] = None,
target_ip: Optional[str] = None,
timeouts: Optional[FirewallTimeoutsArgs] = None,
type: Optional[str] = None) -> Firewall
func GetFirewall(ctx *Context, name string, id IDInput, state *FirewallState, opts ...ResourceOption) (*Firewall, error)
public static Firewall Get(string name, Input<string> id, FirewallState? state, CustomResourceOptions? opts = null)
public static Firewall get(String name, Output<String> id, FirewallState state, CustomResourceOptions options)
resources: _: type: ionoscloud:Firewall get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Datacenter
Id string - [string] The Virtual Data Center ID.
- Firewall
Id string - Icmp
Code string - [int] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen.
- Icmp
Type string - [string] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen. Value null allows all codes.
- Name string
- [string] The name of the firewall rule.
- Nic
Id string - [string] The NIC ID.
- Port
Range doubleEnd - [int] Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- Port
Range doubleStart - [int] Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- Protocol string
- [string] The protocol for the rule: TCP, UDP, ICMP, ANY. Property cannot be modified after creation (disallowed in update requests).
- Server
Id string - [string] The Server ID.
- Source
Ip string - [string] Only traffic originating from the respective IPv4 address is allowed. Value null allows all source IPs.
- Source
Mac string - [string] Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Value null allows all source MAC address. Valid format: aa:bb:cc:dd:ee:ff.
- Target
Ip string - [string] In case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. Value null allows all target IPs.
- Timeouts
Firewall
Timeouts - Type string
- [string] The type of firewall rule. If is not specified, it will take the default value INGRESS.
- Datacenter
Id string - [string] The Virtual Data Center ID.
- Firewall
Id string - Icmp
Code string - [int] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen.
- Icmp
Type string - [string] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen. Value null allows all codes.
- Name string
- [string] The name of the firewall rule.
- Nic
Id string - [string] The NIC ID.
- Port
Range float64End - [int] Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- Port
Range float64Start - [int] Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- Protocol string
- [string] The protocol for the rule: TCP, UDP, ICMP, ANY. Property cannot be modified after creation (disallowed in update requests).
- Server
Id string - [string] The Server ID.
- Source
Ip string - [string] Only traffic originating from the respective IPv4 address is allowed. Value null allows all source IPs.
- Source
Mac string - [string] Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Value null allows all source MAC address. Valid format: aa:bb:cc:dd:ee:ff.
- Target
Ip string - [string] In case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. Value null allows all target IPs.
- Timeouts
Firewall
Timeouts Args - Type string
- [string] The type of firewall rule. If is not specified, it will take the default value INGRESS.
- datacenter
Id String - [string] The Virtual Data Center ID.
- firewall
Id String - icmp
Code String - [int] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen.
- icmp
Type String - [string] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen. Value null allows all codes.
- name String
- [string] The name of the firewall rule.
- nic
Id String - [string] The NIC ID.
- port
Range DoubleEnd - [int] Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- port
Range DoubleStart - [int] Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- protocol String
- [string] The protocol for the rule: TCP, UDP, ICMP, ANY. Property cannot be modified after creation (disallowed in update requests).
- server
Id String - [string] The Server ID.
- source
Ip String - [string] Only traffic originating from the respective IPv4 address is allowed. Value null allows all source IPs.
- source
Mac String - [string] Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Value null allows all source MAC address. Valid format: aa:bb:cc:dd:ee:ff.
- target
Ip String - [string] In case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. Value null allows all target IPs.
- timeouts
Firewall
Timeouts - type String
- [string] The type of firewall rule. If is not specified, it will take the default value INGRESS.
- datacenter
Id string - [string] The Virtual Data Center ID.
- firewall
Id string - icmp
Code string - [int] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen.
- icmp
Type string - [string] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen. Value null allows all codes.
- name string
- [string] The name of the firewall rule.
- nic
Id string - [string] The NIC ID.
- port
Range numberEnd - [int] Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- port
Range numberStart - [int] Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- protocol string
- [string] The protocol for the rule: TCP, UDP, ICMP, ANY. Property cannot be modified after creation (disallowed in update requests).
- server
Id string - [string] The Server ID.
- source
Ip string - [string] Only traffic originating from the respective IPv4 address is allowed. Value null allows all source IPs.
- source
Mac string - [string] Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Value null allows all source MAC address. Valid format: aa:bb:cc:dd:ee:ff.
- target
Ip string - [string] In case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. Value null allows all target IPs.
- timeouts
Firewall
Timeouts - type string
- [string] The type of firewall rule. If is not specified, it will take the default value INGRESS.
- datacenter_
id str - [string] The Virtual Data Center ID.
- firewall_
id str - icmp_
code str - [int] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen.
- icmp_
type str - [string] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen. Value null allows all codes.
- name str
- [string] The name of the firewall rule.
- nic_
id str - [string] The NIC ID.
- port_
range_ floatend - [int] Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- port_
range_ floatstart - [int] Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- protocol str
- [string] The protocol for the rule: TCP, UDP, ICMP, ANY. Property cannot be modified after creation (disallowed in update requests).
- server_
id str - [string] The Server ID.
- source_
ip str - [string] Only traffic originating from the respective IPv4 address is allowed. Value null allows all source IPs.
- source_
mac str - [string] Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Value null allows all source MAC address. Valid format: aa:bb:cc:dd:ee:ff.
- target_
ip str - [string] In case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. Value null allows all target IPs.
- timeouts
Firewall
Timeouts Args - type str
- [string] The type of firewall rule. If is not specified, it will take the default value INGRESS.
- datacenter
Id String - [string] The Virtual Data Center ID.
- firewall
Id String - icmp
Code String - [int] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen.
- icmp
Type String - [string] Defines the allowed code (from 0 to 254) if protocol ICMP is chosen. Value null allows all codes.
- name String
- [string] The name of the firewall rule.
- nic
Id String - [string] The NIC ID.
- port
Range NumberEnd - [int] Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- port
Range NumberStart - [int] Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports.
- protocol String
- [string] The protocol for the rule: TCP, UDP, ICMP, ANY. Property cannot be modified after creation (disallowed in update requests).
- server
Id String - [string] The Server ID.
- source
Ip String - [string] Only traffic originating from the respective IPv4 address is allowed. Value null allows all source IPs.
- source
Mac String - [string] Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Value null allows all source MAC address. Valid format: aa:bb:cc:dd:ee:ff.
- target
Ip String - [string] In case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. Value null allows all target IPs.
- timeouts Property Map
- type String
- [string] The type of firewall rule. If is not specified, it will take the default value INGRESS.
Supporting Types
FirewallTimeouts, FirewallTimeoutsArgs
Import
Resource Firewall can be imported using the resource id
, e.g.
$ pulumi import ionoscloud:index/firewall:Firewall myfwruledatacenter uuid/server uuid/nic uuid/firewall uuid
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ionoscloud ionos-cloud/terraform-provider-ionoscloud
- License
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.