Skip to content

Commit 0a9ad65

Browse files
authored
Fix: Improved the rule reorder logic (#392)
* fix: Fixed reorder logic for all rule based resources
1 parent 9c57ab6 commit 0a9ad65

19 files changed

+267
-84
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Changelog
22

3+
## 4.0.4 (February, 6 2025)
4+
5+
### Notes
6+
7+
- Release date: **(February, 6 2025)**
8+
- Supported Terraform version: **v1.x**
9+
10+
### Bug Fixes
11+
12+
- [PR #392](https://github.com/zscaler/terraform-provider-zia/pull/392) - Improved the rule reorder logic to expedite reorder process for the following resources:
13+
- `zia_firewall_filtering_rule`
14+
- `zia_firewall_dns_rule`
15+
- `zia_firewall_ips_rule`
16+
- `zia_file_type_control_rules`
17+
- `zia_forwarding_control_rule`
18+
- `zia_ssl_inspection_rules`
19+
- `zia_sandbox_rules`
20+
21+
### Documentation
22+
23+
- [PR #392](https://github.com/zscaler/terraform-provider-zia/pull/392) - Updated documentation for tghe following resources describing reorder process and concept of predefined vs default rules
24+
- `zia_firewall_filtering_rule`
25+
- `zia_firewall_dns_rule`
26+
- `zia_ssl_inspection_rules`
27+
328
## 4.0.3 (February, 5 2025)
429

530
### Notes

GNUmakefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,14 @@ test\:integration\:zscalertwo:
196196
build13: GOOS=$(shell go env GOOS)
197197
build13: GOARCH=$(shell go env GOARCH)
198198
ifeq ($(OS),Windows_NT) # is Windows_NT on XP, 2000, 7, Vista, 10...
199-
build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/4.0.2/$(GOOS)_$(GOARCH)
199+
build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/4.0.4/$(GOOS)_$(GOARCH)
200200
else
201-
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/4.0.2/$(GOOS)_$(GOARCH)
201+
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/4.0.4/$(GOOS)_$(GOARCH)
202202
endif
203203
build13: fmtcheck
204204
@echo "==> Installing plugin to $(DESTINATION)"
205205
@mkdir -p $(DESTINATION)
206-
go build -o $(DESTINATION)/terraform-provider-zia_v4.0.2
206+
go build -o $(DESTINATION)/terraform-provider-zia_v4.0.4
207207

208208
coverage: test
209209
@echo "✓ Opening coverage for unit tests ..."

docs/guides/release-notes.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,35 @@ description: |-
1212
Track all ZIA Terraform provider's releases. New resources, features, and bug fixes will be tracked here.
1313

1414
---
15-
``Last updated: v4.0.3``
15+
``Last updated: v4.0.4``
1616

1717
---
1818

19+
## 4.0.4 (February, 6 2025)
20+
21+
### Notes
22+
23+
- Release date: **(February, 6 2025)**
24+
- Supported Terraform version: **v1.x**
25+
26+
### Bug Fixes
27+
28+
- [PR #392](https://github.com/zscaler/terraform-provider-zia/pull/392) - Improved the rule reorder logic to expedite reorder process for the following resources:
29+
- `zia_firewall_filtering_rule`
30+
- `zia_firewall_dns_rule`
31+
- `zia_firewall_ips_rule`
32+
- `zia_file_type_control_rules`
33+
- `zia_forwarding_control_rule`
34+
- `zia_ssl_inspection_rules`
35+
- `zia_sandbox_rules`
36+
37+
### Documentation
38+
39+
- [PR #392](https://github.com/zscaler/terraform-provider-zia/pull/392) - Updated documentation for tghe following resources describing reorder process and concept of predefined vs default rules
40+
- `zia_firewall_filtering_rule`
41+
- `zia_firewall_dns_rule`
42+
- `zia_ssl_inspection_rules`
43+
1944
## 4.0.3 (February, 5 2025)
2045

2146
### Notes

docs/resources/zia_firewall_dns_rules.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,37 @@ description: |-
1010

1111
The **zia_firewall_dns_rule** resource allows the creation and management of ZIA Cloud Firewall DNS rules in the Zscaler Internet Access.
1212

13+
**NOTE 1** Zscaler Cloud Firewall DNS Rules contain default and predefined rules which are placed in their respective orders. These rules `CANNOT` be deleted. When configuring your rules make sure that the `order` attributue value consider these pre-existing rules so that Terraform can place the new rules in the correct position, and drifts can be avoided. i.e If there are 2 pre-existing rules, you should start your rule order at `3` and manage your rule sets from that number onwards. The provider will reorder the rules automatically while ignoring the order of pre-existing rules, as the API will be responsible for moving these rules to their respective positions as API calls are made.
14+
15+
The most common default and predefined rules:
16+
17+
| Rule Names | Default or Predefined | Rule Number Associated |
18+
|:--------------------------------------------:|:------------------------:|:------------------------:|
19+
|-----------------------------|--------------------------|-------------------|
20+
| `Office 365 One Click Rule` | `Predefined` | `Yes` |
21+
| `ZPA Resolver for Road Warrior` | `Predefined` | `Yes` |
22+
| `Critical risk DNS categories` | `Predefined` | `Yes` |
23+
| `Critical risk DNS tunnels` | `Predefined` | `Yes` |
24+
| `High risk DNS categories` | `Predefined` | `Yes` |
25+
| `High risk DNS tunnels` | `Predefined` | `Yes` |
26+
| `Risky DNS categories` | `Predefined` | `Yes` |
27+
| `Risky DNS Risky DNS tunnels` | `Predefined` | `Yes` |
28+
| `Unknown DNS Traffic` | `Predefined` | `Yes` |
29+
| `Default Firewall DNS Rule` | `Predefined` | `Yes` |
30+
| `ZPA Resolver for Locations` | `Default` | `No` |
31+
| `Fallback ZPA Resolver for Locations` | `Default` | `No` |
32+
| `Fallback ZPA Resolver for Road Warrior` | `Default` | `No` |
33+
|-------------------------|-------------------------|-----------------|
34+
35+
**NOTE 2** Certain attributes on `predefined` rules can still be managed or updated via Terraform such as:
36+
37+
- `description` - (Optional) Enter additional notes or information. The description cannot exceed 10,240 characters.
38+
- `state` - (Optional) An enabled rule is actively enforced. A disabled rule is not actively enforced but does not lose its place in the Rule Order. The service skips it and moves to
39+
- `labels` (list) - Labels that are applicable to the rule.
40+
- `id` - (Integer) Identifier that uniquely identifies an entity
41+
42+
**NOTE 3** The import of `predefined` rules is still possible in case you want o have them under the Terraform management; however, remember that these rules cannot be deleted. That means, the provider will fail when executing `terraform destroy`; hence, you must remove the rules you want to delete, and re-run `terraform apply` instead.
43+
1344
## Example Usage - Create Firewall DNS Rules - Redirect Action
1445

1546
```hcl

0 commit comments

Comments
 (0)