terraform-provider-unifi icon indicating copy to clipboard operation
terraform-provider-unifi copied to clipboard

Automanage firewall indices

Open lkubb opened this issue 1 year ago • 1 comments

Currently, it's a very error-prone and manual process to ensure firewall rules are applied in a specific order (unless I'm missing something – always happy to learn :)).

This PR a) allows the rule index to not be specified and attempts to autodiscover an unoccupied one b) introduces a new resource (unifi_firewall_ruleset) that manages the ordering of firewall rules.

I'm not sure if this is the best approach, but I did not think a substantial change to how firewall rules are managed currently would be worth the trouble.

This resource is virtual and will be auto-imported during creation. There can only be a single resource per site + ruleset combination. It requires all rule IDs that are present in the ruleset to be specified and disallows managing rule indices if it discovers unknown rules.

Fixes: https://github.com/paultyng/terraform-provider-unifi/issues/361

This requires https://github.com/paultyng/go-unifi/pull/127, I will need to update this PR when that one is released.

lkubb avatar Apr 27 '23 14:04 lkubb

@paultyng @joshuaspence Any chance of getting a new go-unifi release and this provider being updated to be able to use it anytime soon? This PR relies on changes that were merged in June, but are still unreleased.

lkubb avatar Sep 14 '23 18:09 lkubb