-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
82 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "unifi_firewall_ruleset Resource - terraform-provider-unifi" | ||
subcategory: "" | ||
description: |- | ||
unifi_firewall_ruleset manages the order of individual firewall rules in a ruleset. You must provide all rule IDs present in the set for this to succeed. There can only be one ruleset resource per site and ruleset combination. Since this resource will be managed on-the-fly, importing it is optional. | ||
--- | ||
|
||
# unifi_firewall_ruleset (Resource) | ||
|
||
`unifi_firewall_ruleset` manages the order of individual firewall rules in a ruleset. You must provide all rule IDs present in the set for this to succeed. There can only be one ruleset resource per site and ruleset combination. Since this resource will be managed on-the-fly, importing it is optional. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
variable "tgt_ip_address" { | ||
type = string | ||
} | ||
variable "src_ip_address" { | ||
type = string | ||
} | ||
resource "unifi_firewall_rule" "allow_from" { | ||
name = "drop all" | ||
action = "drop" | ||
ruleset = "LAN_IN" | ||
protocol = "all" | ||
src_address = var.src_ip_address | ||
dst_address = var.tgt_ip_address | ||
} | ||
resource "unifi_firewall_rule" "drop_all" { | ||
name = "drop all" | ||
action = "drop" | ||
ruleset = "LAN_IN" | ||
protocol = "all" | ||
dst_address = var.tgt_ip_address | ||
} | ||
resource "unifi_firewall_ruleset" "lan_in" { | ||
ruleset = "LAN_IN" | ||
before_predefined = [ | ||
unifi_firewall_rule.allow_from.id, | ||
unifi_firewall_rule.drop_all.id, | ||
] | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `ruleset` (String) The ruleset to manage. This is from the perspective of the security gateway. Must be one of `WAN_IN`, `WAN_OUT`, `WAN_LOCAL`, `LAN_IN`, `LAN_OUT`, `LAN_LOCAL`, `GUEST_IN`, `GUEST_OUT`, `GUEST_LOCAL`, `WANv6_IN`, `WANv6_OUT`, `WANv6_LOCAL`, `LANv6_IN`, `LANv6_OUT`, `LANv6_LOCAL`, `GUESTv6_IN`, `GUESTv6_OUT`, or `GUESTv6_LOCAL`. | ||
|
||
### Optional | ||
|
||
- `after_predefined` (List of String) List of unique rule IDs present in this ruleset in order of their designated index that should be applied after predefined rules. | ||
- `before_predefined` (List of String) List of unique rule IDs present in this ruleset in order of their designated index that should be applied before predefined rules. | ||
- `site` (String) The name of the site this ruleset is associated with. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of the firewall ruleset. It is a concatenation of `<name>:<ruleset>`. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
# import using the concatenation of site and ruleset name as ID | ||
terraform import unifi_firewall_ruleset.lan_in default:LAN_IN | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters