Skip to content

Commit 5fd3cb3

Browse files
authored
fix: optimize datasources to use bulk GetAll API calls with local filtering (#500)
* fix: optimize datasources to use bulk GetAll API calls with local filtering
1 parent bb7802b commit 5fd3cb3

23 files changed

+2167
-168
lines changed

CHANGELOG.md

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

3+
## 4.6.3 (November, 24 2025)
4+
5+
### Notes
6+
7+
- Release date: **(November, 24 2025)**
8+
- Supported Terraform version: **v1.x**
9+
10+
### Enhancements
11+
12+
- [PR #500](https://github.com/zscaler/terraform-provider-zia/pull/500) - Added the following new datasources and resources `zia_traffic_capture_rules` - Manage Traffic Capture Policy Rules in ZIA. This resource can be used to create, update, delete and retrieve traffic capture rules.
13+
14+
### Bug Fixes
15+
16+
- [PR #500](https://github.com/zscaler/terraform-provider-zia/pull/500) - Enhanced `zia_traffic_forwarding_static_ip` resource documentation with comprehensive examples, migration guide, and troubleshooting for automatic coordinate determination feature.
17+
- [PR #500](https://github.com/zscaler/terraform-provider-zia/pull/500) - Optimized `zia_user_management_groups` datasource to use bulk `GetAll` API call with local filtering for better performance and rate limit management.
18+
- [PR #500](https://github.com/zscaler/terraform-provider-zia/pull/500) - Optimized `zia_user_management_users` datasource to use bulk `GetAll` API call with local filtering for better performance and rate limit management.
19+
- [PR #500](https://github.com/zscaler/terraform-provider-zia/pull/500) - Optimized `zia_fw_filtering_time_window` datasource to use bulk `GetAll` API call with local filtering for better performance and rate limit management.
20+
- [PR #500](https://github.com/zscaler/terraform-provider-zia/pull/500) - Optimized `zia_rule_labels` datasource to use bulk `GetAll` API call with local filtering for better performance and rate limit management.
21+
- [PR #500](https://github.com/zscaler/terraform-provider-zia/pull/500) - Optimized `zia_user_management_departments` datasource to use bulk `GetAll` API call with local filtering for better performance and rate limit management.
22+
323
## 4.6.2 (November, 20 2025)
424

525
### 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.6.2/$(GOOS)_$(GOARCH)
199+
build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/4.6.3/$(GOOS)_$(GOARCH)
200200
else
201-
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/4.6.2/$(GOOS)_$(GOARCH)
201+
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/4.6.3/$(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.6.2
206+
go build -o $(DESTINATION)/terraform-provider-zia_v4.6.3
207207

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

docs/data-sources/zia_firewall_filtering_rule.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
subcategory: "Firewall Policies"
33
layout: "zscaler"
4-
page_title: "ZIA): firewall_filtering_rule"
4+
page_title: "ZIA: firewall_filtering_rule"
55
description: |-
66
Official documentation https://help.zscaler.com/zia/firewall-policies#/firewallFilteringRules-post
77
API documentation https://help.zscaler.com/zia/firewall-policies#/firewallFilteringRules-post
@@ -87,6 +87,8 @@ In addition to all arguments above, the following attributes are exported:
8787
- `extensions` - (Map of String)
8888
* `src_ips` - (Optional) You can enter individual IP addresses, subnets, or address ranges.
8989

90+
* `exclude_src_countries` - (Boolean) Indicates whether the countries specified in the sourceCountries field are included or excluded from the rule. A true value denotes that the specified source countries are excluded from the rule. A false value denotes that the rule is applied to the source countries if there is a match.
91+
9092
`destinations` supports the following attributes:
9193

9294
* `dest_addresses`** - (List of String) - IP addresses and fully qualified domain names (FQDNs), if the domain has multiple destination IP addresses or if its IP addresses may change. For IP addresses, you can enter individual IP addresses, subnets, or address ranges. If adding multiple items, hit Enter after each entry.
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
---
2+
subcategory: "Traffic Capture Policy"
3+
layout: "zscaler"
4+
page_title: "ZIA: traffic_capture_rules"
5+
description: |-
6+
Official documentation https://help.zscaler.com/zia/about-traffic-capture-policy
7+
API documentation https://help.zscaler.com/zia/traffic-capture-policy#/trafficCaptureRules-get
8+
Get information about traffic capture rules
9+
---
10+
11+
# zia_traffic_capture_rules (Data Source)
12+
13+
* [Official documentation](https://help.zscaler.com/zia/about-traffic-capture-policy)
14+
* [API documentation](https://help.zscaler.com/zia/traffic-capture-policy#/trafficCaptureRules-get)
15+
16+
Use the **zia_traffic_capture_rules** data source to get information about a traffic capture rules available in the Zscaler Internet Access cloud firewall.
17+
18+
## Example Usage - Retrieve by Name
19+
20+
```hcl
21+
data "zia_traffic_capture_rules" "example" {
22+
name = "Capture_Rule01"
23+
}
24+
```
25+
26+
## Example Usage - Retrieve by ID
27+
28+
```hcl
29+
data "zia_traffic_capture_rules" "example" {
30+
id = 1254674585
31+
}
32+
```
33+
34+
## Argument Reference
35+
36+
The following arguments are supported:
37+
38+
### Required
39+
40+
At least one of the following must be provided:
41+
42+
* `id` - (Integer) Unique identifier for the Traffic Capture policy rule
43+
* `name` - (String) Name of the Traffic Capture policy rule
44+
45+
## Attribute Reference
46+
47+
In addition to all arguments above, the following attributes are exported:
48+
49+
* `description` - (String) Additional information about the rule. Cannot exceed 10,240 characters.
50+
* `order` - (Integer) Rule order number. Policy rules are evaluated in ascending numerical order.
51+
* `rank` - (Integer) Admin rank of the Traffic Capture policy rule. Default value is `7`.
52+
* `state` - (String) Rule state. An enabled rule is actively enforced. Values: `ENABLED`, `DISABLED`
53+
* `action` - (String) The action the rule takes when packets match. Values: `CAPTURE`, `SKIP`
54+
* `access_control` - (String) The admin's access privilege to this rule based on the assigned role
55+
* `default_rule` - (Boolean) Indicates if this is a default rule
56+
* `predefined` - (Boolean) Indicates if this is a predefined rule
57+
* `txn_size_limit` - (String) The maximum size of traffic to capture per connection. Supported Values: `NONE`, `UNLIMITED`, `THIRTY_TWO_KB`, `TWO_FIFTY_SIX_KB`, `TWO_MB`, `FOUR_MB`, `THIRTY_TWO_MB`, `SIXTY_FOUR_MB`
58+
59+
* `txn_sampling` - (String) The percentage of connections sampled for capturing each time the rule is triggered. Supported Values: `NONE`, `ONE_PERCENT`, `TWO_PERCENT`, `FIVE_PERCENT`, `TEN_PERCENT`, `TWENTY_FIVE_PERCENT`, `HUNDRED_PERCENT`
60+
61+
* `last_modified_time` - (Integer) Timestamp when the rule was last modified
62+
63+
### Last Modified By
64+
65+
* `last_modified_by` - (List) User who last modified the rule
66+
* `id` - (Integer) Identifier of the user
67+
* `name` - (String) Name of the user
68+
* `extensions` - (Map of String) Additional user extensions
69+
70+
### Who, Where and When
71+
72+
* `locations` - (List) Locations for which the rule applies. You can manually select up to `8` locations.
73+
* `id` - (Integer) Identifier that uniquely identifies an entity
74+
* `name` - (String) The configured name of the entity
75+
* `extensions` - (Map of String) Additional location extensions
76+
77+
* `location_groups` - (List) Location groups for which the rule applies. You can manually select up to `32` location groups.
78+
* `id` - (Integer) Identifier that uniquely identifies an entity
79+
* `name` - (String) The configured name of the entity
80+
* `extensions` - (Map of String) Additional location group extensions
81+
82+
* `users` - (List) Users for which the rule applies. You can manually select up to `4` general and/or special users.
83+
* `id` - (Integer) Identifier that uniquely identifies an entity
84+
* `name` - (String) The configured name of the entity
85+
* `extensions` - (Map of String) Additional user extensions
86+
87+
* `groups` - (List) Groups for which the rule applies. You can manually select up to `8` groups.
88+
* `id` - (Integer) Identifier that uniquely identifies an entity
89+
* `name` - (String) The configured name of the entity
90+
* `extensions` - (Map of String) Additional group extensions
91+
92+
* `departments` - (List) Departments for which the rule applies. You can apply to any number of departments.
93+
* `id` - (Integer) Identifier that uniquely identifies an entity
94+
* `name` - (String) The configured name of the entity
95+
* `extensions` - (Map of String) Additional department extensions
96+
97+
* `time_windows` - (List) Time intervals in which the rule applies. You can manually select up to `2` time intervals.
98+
* `id` - (Integer) Identifier that uniquely identifies an entity
99+
* `name` - (String) The configured name of the entity
100+
* `extensions` - (Map of String) Additional time window extensions
101+
102+
### Network Services
103+
104+
* `nw_services` - (List) Network services for which the rule applies. The Zscaler firewall has predefined services and you can configure up to `1,024` additional custom services.
105+
* `id` - (Integer) Identifier that uniquely identifies an entity
106+
* `name` - (String) The configured name of the entity
107+
* `extensions` - (Map of String) Additional network service extensions
108+
109+
* `nw_service_groups` - (List) Network service groups for which the rule applies.
110+
* `id` - (Integer) Identifier that uniquely identifies an entity
111+
* `name` - (String) The configured name of the entity
112+
* `extensions` - (Map of String) Additional network service group extensions
113+
114+
### Network Applications
115+
116+
* `nw_applications` - (List of String) Network service applications. The service provides predefined applications.
117+
118+
* `nw_application_groups` - (List) Network application groups for which the rule applies.
119+
* `id` - (Integer) Identifier that uniquely identifies an entity
120+
* `name` - (String) The configured name of the entity
121+
* `extensions` - (Map of String) Additional network application group extensions
122+
123+
### Source IP
124+
125+
* `src_ip_groups` - (Optional) Any number of source IP address groups that you want to control with this rule.
126+
- `id` - (String) Identifier that uniquely identifies an entity
127+
- `name` - (String) The configured name of the entity
128+
- `extensions` - (Map of String)
129+
130+
* `src_ips` - (Optional) You can enter individual IP addresses, subnets, or address ranges.
131+
132+
* `source_countries`** - (List of String) Identify destinations based on the location of a server. Provide a 2 letter [ISO3166 Alpha2 Country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). i.e ``"US"``, ``"CA"``
133+
134+
* `exclude_src_countries` - (Boolean) Indicates whether the countries specified in the sourceCountries field are included or excluded from the rule. A true value denotes that the specified source countries are excluded from the rule. A false value denotes that the rule is applied to the source countries if there is a match.
135+
136+
### Destination IP
137+
138+
* `dest_ip_groups`** - (Optional) Any number of destination IP address groups that you want to control with this rule.
139+
- `id` - (String) Identifier that uniquely identifies an entity
140+
- `name` - (String) The configured name of the entity
141+
- `extensions` - (Map of String)
142+
143+
* `dest_addresses`** - (List of String) - IP addresses and fully qualified domain names (FQDNs), if the domain has multiple destination IP addresses or if its IP addresses may change. For IP addresses, you can enter individual IP addresses, subnets, or address ranges. If adding multiple items, hit Enter after each entry.
144+
* `dest_countries`** - (List of String) Identify destinations based on the location of a server. Provide a 2 letter [ISO3166 Alpha2 Country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). i.e ``"US"``, ``"CA"``
145+
146+
### Workload Group
147+
148+
* `workload_groups` (List) The list of preconfigured workload groups to which the policy must be applied
149+
* `id` - (Number) A unique identifier assigned to the workload group
150+
* `name` - (String) The name of the workload group

docs/data-sources/zia_url_categories.md

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,68 @@ description: |-
1515

1616
Use the **zia_url_categories** data source to get information about all or custom URL categories. By default, the response includes keywords.
1717

18+
## Example Usage - Query a URL Category by Name (Default - All Types)
19+
1820
```hcl
19-
// Query a URL Category by Name
20-
data "zia_url_categories" "this"{
21+
data "zia_url_categories" "this" {
2122
configured_name = "Example"
2223
}
2324
```
2425

26+
## Example Usage - Query a URL Category by ID
27+
2528
```hcl
26-
// Query a URL Category by its Custom ID
27-
data "zia_url_categories" "this"{
29+
data "zia_url_categories" "this" {
2830
id = "CUSTOM_08"
2931
}
3032
```
3133

34+
## Example Usage - Query a URL_CATEGORY Type
35+
36+
```hcl
37+
data "zia_url_categories" "url_category_example" {
38+
configured_name = "My URL Category"
39+
type = "URL_CATEGORY"
40+
}
41+
```
42+
43+
## Example Usage - Query a TLD_CATEGORY Type
44+
45+
```hcl
46+
data "zia_url_categories" "tld_category_example" {
47+
configured_name = "tld_russia"
48+
type = "TLD_CATEGORY"
49+
}
50+
```
51+
52+
## Example Usage - Query All Category Types (Explicit)
53+
54+
```hcl
55+
data "zia_url_categories" "all_types_example" {
56+
configured_name = "Example"
57+
type = "ALL"
58+
}
59+
```
60+
3261
## Argument Reference
3362

3463
The following arguments are supported:
3564

36-
* `id` - (String) URL category
65+
### Required
66+
67+
At least one of the following must be provided:
68+
69+
* `id` - (String) URL category ID
70+
* `configured_name` - (String) Name of the URL category
71+
72+
### Optional
73+
74+
* `type` - (String) Type of URL categories to retrieve. Valid values:
75+
* `ALL` (default) - Retrieves all category types (URL_CATEGORY and TLD_CATEGORY)
76+
* `URL_CATEGORY` - Retrieves only URL-based custom categories
77+
* `TLD_CATEGORY` - Retrieves only TLD-based custom categories
78+
79+
**Note:** When searching by name, this parameter filters which types of categories are searched. For TLD categories, you must either use `type = "TLD_CATEGORY"` or `type = "ALL"` (default).
3780

3881
## Attribute Reference
3982

docs/guides/release-notes.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,30 @@ 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.6.2``
15+
``Last updated: v4.6.3``
1616

1717
---
1818

19+
## 4.6.3 (November, 24 2025)
20+
21+
### Notes
22+
23+
- Release date: **(November, 24 2025)**
24+
- Supported Terraform version: **v1.x**
25+
26+
### Enhancements
27+
28+
- [PR #500](https://github.com/zscaler/terraform-provider-zia/pull/500) - Added the following new datasources and resources `zia_traffic_capture_rules` - Manage Traffic Capture Policy Rules in ZIA. This resource can be used to create, update, delete and retrieve traffic capture rules.
29+
30+
### Bug Fixes
31+
32+
- [PR #500](https://github.com/zscaler/terraform-provider-zia/pull/500) - Enhanced `zia_traffic_forwarding_static_ip` resource documentation with comprehensive examples, migration guide, and troubleshooting for automatic coordinate determination feature.
33+
- [PR #500](https://github.com/zscaler/terraform-provider-zia/pull/500) - Optimized `zia_user_management_groups` datasource to use bulk `GetAll` API call with local filtering for better performance and rate limit management.
34+
- [PR #500](https://github.com/zscaler/terraform-provider-zia/pull/500) - Optimized `zia_user_management_users` datasource to use bulk `GetAll` API call with local filtering for better performance and rate limit management.
35+
- [PR #500](https://github.com/zscaler/terraform-provider-zia/pull/500) - Optimized `zia_fw_filtering_time_window` datasource to use bulk `GetAll` API call with local filtering for better performance and rate limit management.
36+
- [PR #500](https://github.com/zscaler/terraform-provider-zia/pull/500) - Optimized `zia_rule_labels` datasource to use bulk `GetAll` API call with local filtering for better performance and rate limit management.
37+
- [PR #500](https://github.com/zscaler/terraform-provider-zia/pull/500) - Optimized `zia_user_management_departments` datasource to use bulk `GetAll` API call with local filtering for better performance and rate limit management.
38+
1939
## 4.6.2 (November, 20 2025)
2040

2141
### Notes

0 commit comments

Comments
 (0)