# danubedata.Firewall
Manages a firewall with rules for network traffic control.
Example Usage
Basic Firewall
Example coming soon!
Example coming soon!
Example coming soon!
Example coming soon!
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.danubedata.Firewall;
import com.pulumi.danubedata.FirewallArgs;
import com.pulumi.danubedata.inputs.FirewallRuleArgs;
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 web = new Firewall("web", FirewallArgs.builder()
.defaultAction("deny")
.description("Allow HTTP/HTTPS and SSH")
.rules(
FirewallRuleArgs.builder()
.action("allow")
.direction("inbound")
.name("Allow SSH")
.port_range_end(22)
.port_range_start(22)
.priority(100)
.protocol("tcp")
.source_ips("0.0.0.0/0")
.build(),
FirewallRuleArgs.builder()
.action("allow")
.direction("inbound")
.name("Allow HTTP")
.port_range_end(80)
.port_range_start(80)
.priority(200)
.protocol("tcp")
.source_ips("0.0.0.0/0")
.build(),
FirewallRuleArgs.builder()
.action("allow")
.direction("inbound")
.name("Allow HTTPS")
.port_range_end(443)
.port_range_start(443)
.priority(300)
.protocol("tcp")
.source_ips("0.0.0.0/0")
.build())
.build());
}
}
resources:
web:
type: danubedata:Firewall
properties:
defaultAction: deny
description: Allow HTTP/HTTPS and SSH
rules:
- action: allow
direction: inbound
name: Allow SSH
port_range_end: 22
port_range_start: 22
priority: 100
protocol: tcp
source_ips:
- 0.0.0.0/0
- action: allow
direction: inbound
name: Allow HTTP
port_range_end: 80
port_range_start: 80
priority: 200
protocol: tcp
source_ips:
- 0.0.0.0/0
- action: allow
direction: inbound
name: Allow HTTPS
port_range_end: 443
port_range_start: 443
priority: 300
protocol: tcp
source_ips:
- 0.0.0.0/0
Firewall with IP Restrictions
Example coming soon!
Example coming soon!
Example coming soon!
Example coming soon!
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.danubedata.Firewall;
import com.pulumi.danubedata.FirewallArgs;
import com.pulumi.danubedata.inputs.FirewallRuleArgs;
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 admin = new Firewall("admin", FirewallArgs.builder()
.defaultAction("deny")
.description("Restricted admin access")
.rules(
FirewallRuleArgs.builder()
.action("allow")
.direction("inbound")
.name("Allow SSH from office")
.port_range_end(22)
.port_range_start(22)
.priority(100)
.protocol("tcp")
.source_ips(
"203.0.113.0/24",
"198.51.100.0/24")
.build(),
FirewallRuleArgs.builder()
.action("allow")
.direction("outbound")
.name("Allow all outbound")
.priority(1000)
.protocol("all")
.source_ips("0.0.0.0/0")
.build())
.build());
}
}
resources:
admin:
type: danubedata:Firewall
properties:
defaultAction: deny
description: Restricted admin access
rules:
- action: allow
direction: inbound
name: Allow SSH from office
port_range_end: 22
port_range_start: 22
priority: 100
protocol: tcp
source_ips:
- 203.0.113.0/24
- 198.51.100.0/24
- action: allow
direction: outbound
name: Allow all outbound
priority: 1000
protocol: all
source_ips:
- 0.0.0.0/0
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: Optional[FirewallArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Firewall(resource_name: str,
opts: Optional[ResourceOptions] = None,
default_action: Optional[str] = None,
description: Optional[str] = None,
is_default: Optional[bool] = None,
name: Optional[str] = None,
rules: Optional[Sequence[FirewallRuleArgs]] = None)func NewFirewall(ctx *Context, name string, args *FirewallArgs, opts ...ResourceOption) (*Firewall, error)public Firewall(string name, FirewallArgs? args = null, CustomResourceOptions? opts = null)
public Firewall(String name, FirewallArgs args)
public Firewall(String name, FirewallArgs args, CustomResourceOptions options)
type: danubedata: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 DanubeData.Firewall("firewallResource", new()
{
DefaultAction = "string",
Description = "string",
IsDefault = false,
Name = "string",
Rules = new[]
{
new DanubeData.Inputs.FirewallRuleArgs
{
Action = "string",
Direction = "string",
Protocol = "string",
Id = "string",
Name = "string",
PortRangeEnd = 0,
PortRangeStart = 0,
Priority = 0,
SourceIps = new[]
{
"string",
},
},
},
});
example, err := danubedata.NewFirewall(ctx, "firewallResource", &danubedata.FirewallArgs{
DefaultAction: pulumi.String("string"),
Description: pulumi.String("string"),
IsDefault: pulumi.Bool(false),
Name: pulumi.String("string"),
Rules: danubedata.FirewallRuleArray{
&danubedata.FirewallRuleArgs{
Action: pulumi.String("string"),
Direction: pulumi.String("string"),
Protocol: pulumi.String("string"),
Id: pulumi.String("string"),
Name: pulumi.String("string"),
PortRangeEnd: pulumi.Int(0),
PortRangeStart: pulumi.Int(0),
Priority: pulumi.Int(0),
SourceIps: pulumi.StringArray{
pulumi.String("string"),
},
},
},
})
var firewallResource = new Firewall("firewallResource", FirewallArgs.builder()
.defaultAction("string")
.description("string")
.isDefault(false)
.name("string")
.rules(FirewallRuleArgs.builder()
.action("string")
.direction("string")
.protocol("string")
.id("string")
.name("string")
.portRangeEnd(0)
.portRangeStart(0)
.priority(0)
.sourceIps("string")
.build())
.build());
firewall_resource = danubedata.Firewall("firewallResource",
default_action="string",
description="string",
is_default=False,
name="string",
rules=[{
"action": "string",
"direction": "string",
"protocol": "string",
"id": "string",
"name": "string",
"port_range_end": 0,
"port_range_start": 0,
"priority": 0,
"source_ips": ["string"],
}])
const firewallResource = new danubedata.Firewall("firewallResource", {
defaultAction: "string",
description: "string",
isDefault: false,
name: "string",
rules: [{
action: "string",
direction: "string",
protocol: "string",
id: "string",
name: "string",
portRangeEnd: 0,
portRangeStart: 0,
priority: 0,
sourceIps: ["string"],
}],
});
type: danubedata:Firewall
properties:
defaultAction: string
description: string
isDefault: false
name: string
rules:
- action: string
direction: string
id: string
name: string
portRangeEnd: 0
portRangeStart: 0
priority: 0
protocol: string
sourceIps:
- 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:
- Default
Action string - Default action for traffic not matching any rule: 'drop' or 'accept'.
- Description string
- Description of the firewall.
- Is
Default bool - Whether this is the default firewall for the team.
- Name string
- Name of the firewall.
- Rules
List<Danube
Data. Danube Data. Inputs. Firewall Rule> - List of firewall rules.
- Default
Action string - Default action for traffic not matching any rule: 'drop' or 'accept'.
- Description string
- Description of the firewall.
- Is
Default bool - Whether this is the default firewall for the team.
- Name string
- Name of the firewall.
- Rules
[]Firewall
Rule Args - List of firewall rules.
- default
Action String - Default action for traffic not matching any rule: 'drop' or 'accept'.
- description String
- Description of the firewall.
- is
Default Boolean - Whether this is the default firewall for the team.
- name String
- Name of the firewall.
- rules
List<Firewall
Rule> - List of firewall rules.
- default
Action string - Default action for traffic not matching any rule: 'drop' or 'accept'.
- description string
- Description of the firewall.
- is
Default boolean - Whether this is the default firewall for the team.
- name string
- Name of the firewall.
- rules
Firewall
Rule[] - List of firewall rules.
- default_
action str - Default action for traffic not matching any rule: 'drop' or 'accept'.
- description str
- Description of the firewall.
- is_
default bool - Whether this is the default firewall for the team.
- name str
- Name of the firewall.
- rules
Sequence[Firewall
Rule Args] - List of firewall rules.
- default
Action String - Default action for traffic not matching any rule: 'drop' or 'accept'.
- description String
- Description of the firewall.
- is
Default Boolean - Whether this is the default firewall for the team.
- name String
- Name of the firewall.
- rules List<Property Map>
- List of firewall rules.
Outputs
All input properties are implicitly available as output properties. Additionally, the Firewall resource produces the following output properties:
- created_
at str - Creation timestamp.
- id str
- The provider-assigned unique ID for this managed resource.
- status str
- Current status of the firewall.
- updated_
at str - Timestamp when the firewall was last updated.
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,
created_at: Optional[str] = None,
default_action: Optional[str] = None,
description: Optional[str] = None,
is_default: Optional[bool] = None,
name: Optional[str] = None,
rules: Optional[Sequence[FirewallRuleArgs]] = None,
status: Optional[str] = None,
updated_at: Optional[str] = None) -> Firewallfunc 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: danubedata: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.
- Created
At string - Creation timestamp.
- Default
Action string - Default action for traffic not matching any rule: 'drop' or 'accept'.
- Description string
- Description of the firewall.
- Is
Default bool - Whether this is the default firewall for the team.
- Name string
- Name of the firewall.
- Rules
List<Danube
Data. Danube Data. Inputs. Firewall Rule> - List of firewall rules.
- Status string
- Current status of the firewall.
- Updated
At string - Timestamp when the firewall was last updated.
- Created
At string - Creation timestamp.
- Default
Action string - Default action for traffic not matching any rule: 'drop' or 'accept'.
- Description string
- Description of the firewall.
- Is
Default bool - Whether this is the default firewall for the team.
- Name string
- Name of the firewall.
- Rules
[]Firewall
Rule Args - List of firewall rules.
- Status string
- Current status of the firewall.
- Updated
At string - Timestamp when the firewall was last updated.
- created
At String - Creation timestamp.
- default
Action String - Default action for traffic not matching any rule: 'drop' or 'accept'.
- description String
- Description of the firewall.
- is
Default Boolean - Whether this is the default firewall for the team.
- name String
- Name of the firewall.
- rules
List<Firewall
Rule> - List of firewall rules.
- status String
- Current status of the firewall.
- updated
At String - Timestamp when the firewall was last updated.
- created
At string - Creation timestamp.
- default
Action string - Default action for traffic not matching any rule: 'drop' or 'accept'.
- description string
- Description of the firewall.
- is
Default boolean - Whether this is the default firewall for the team.
- name string
- Name of the firewall.
- rules
Firewall
Rule[] - List of firewall rules.
- status string
- Current status of the firewall.
- updated
At string - Timestamp when the firewall was last updated.
- created_
at str - Creation timestamp.
- default_
action str - Default action for traffic not matching any rule: 'drop' or 'accept'.
- description str
- Description of the firewall.
- is_
default bool - Whether this is the default firewall for the team.
- name str
- Name of the firewall.
- rules
Sequence[Firewall
Rule Args] - List of firewall rules.
- status str
- Current status of the firewall.
- updated_
at str - Timestamp when the firewall was last updated.
- created
At String - Creation timestamp.
- default
Action String - Default action for traffic not matching any rule: 'drop' or 'accept'.
- description String
- Description of the firewall.
- is
Default Boolean - Whether this is the default firewall for the team.
- name String
- Name of the firewall.
- rules List<Property Map>
- List of firewall rules.
- status String
- Current status of the firewall.
- updated
At String - Timestamp when the firewall was last updated.
Supporting Types
FirewallRule, FirewallRuleArgs
- Action string
- Action:
allowordeny. - Direction string
- Direction:
inboundoroutbound. - Protocol string
- Protocol:
tcp,udp,icmp, orall. - Id string
- The firewall ID.
- Name string
- Name of the rule.
- Port
Range intEnd - End of port range.
- Port
Range intStart - Start of port range.
- Priority int
- Rule priority (lower = higher priority).
- Source
Ips List<string> - List of source IP addresses/CIDRs.
- Action string
- Action:
allowordeny. - Direction string
- Direction:
inboundoroutbound. - Protocol string
- Protocol:
tcp,udp,icmp, orall. - Id string
- The firewall ID.
- Name string
- Name of the rule.
- Port
Range intEnd - End of port range.
- Port
Range intStart - Start of port range.
- Priority int
- Rule priority (lower = higher priority).
- Source
Ips []string - List of source IP addresses/CIDRs.
- action String
- Action:
allowordeny. - direction String
- Direction:
inboundoroutbound. - protocol String
- Protocol:
tcp,udp,icmp, orall. - id String
- The firewall ID.
- name String
- Name of the rule.
- port
Range IntegerEnd - End of port range.
- port
Range IntegerStart - Start of port range.
- priority Integer
- Rule priority (lower = higher priority).
- source
Ips List<String> - List of source IP addresses/CIDRs.
- action string
- Action:
allowordeny. - direction string
- Direction:
inboundoroutbound. - protocol string
- Protocol:
tcp,udp,icmp, orall. - id string
- The firewall ID.
- name string
- Name of the rule.
- port
Range numberEnd - End of port range.
- port
Range numberStart - Start of port range.
- priority number
- Rule priority (lower = higher priority).
- source
Ips string[] - List of source IP addresses/CIDRs.
- action str
- Action:
allowordeny. - direction str
- Direction:
inboundoroutbound. - protocol str
- Protocol:
tcp,udp,icmp, orall. - id str
- The firewall ID.
- name str
- Name of the rule.
- port_
range_ intend - End of port range.
- port_
range_ intstart - Start of port range.
- priority int
- Rule priority (lower = higher priority).
- source_
ips Sequence[str] - List of source IP addresses/CIDRs.
- action String
- Action:
allowordeny. - direction String
- Direction:
inboundoroutbound. - protocol String
- Protocol:
tcp,udp,icmp, orall. - id String
- The firewall ID.
- name String
- Name of the rule.
- port
Range NumberEnd - End of port range.
- port
Range NumberStart - Start of port range.
- priority Number
- Rule priority (lower = higher priority).
- source
Ips List<String> - List of source IP addresses/CIDRs.
Import
Firewalls can be imported using their ID:
bash
$ pulumi import danubedata:index/firewall:Firewall example fw-abc123
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- danubedata AdrianSilaghi/pulumi-danubedata
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
danubedataTerraform Provider.
