Skip to content

Commit 1e7dffa

Browse files
authored
feat: Added New File Type Control Data Sources Resources and Fixes (#496)
* feat: Added New File Type Control Data Sources Resources and Fixes
1 parent 2ee3537 commit 1e7dffa

20 files changed

+786
-74
lines changed

CHANGELOG.md

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

3+
## 4.6.0 (November, 19 2025)
4+
5+
### Notes
6+
7+
- Release date: **(November, 19 2025)**
8+
- Supported Terraform version: **v1.x**
9+
10+
### Enhancements
11+
12+
- [PR #495](https://github.com/zscaler/terraform-provider-zia/pull/495) - Added new data source `zia_file_type_categories`. This datasource can be referenced within the `zia_dlp_web_rules` in the attribute `file_type_categories`
13+
- [PR #495](https://github.com/zscaler/terraform-provider-zia/pull/495) - Added new data source and resource `zia_custom_file_types`
14+
- [PR #495](https://github.com/zscaler/terraform-provider-zia/pull/495) - Improved `zia_url_categories` resource READ function for better state refresh and rate limiting conservation.
15+
16+
### Bug Fixes
17+
18+
- [PR #495](https://github.com/zscaler/terraform-provider-zia/pull/495) - Upgraded to [Zscaler SDK GO v3.8.6](https://github.com/zscaler/zscaler-sdk-go/releases/tag/v3.8.6) to fix pagination in some resources.
19+
- [PR #495](https://github.com/zscaler/terraform-provider-zia/pull/495) - Fixed drift with attribute `static_location_groups` in the resource `zia_location_management`
20+
321
## 4.5.3 (October, 17 2025)
422

523
### 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.5.3/$(GOOS)_$(GOARCH)
199+
build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/4.6.0/$(GOOS)_$(GOARCH)
200200
else
201-
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/4.5.3/$(GOOS)_$(GOARCH)
201+
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/4.6.0/$(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.5.3
206+
go build -o $(DESTINATION)/terraform-provider-zia_v4.6.0
207207

208208
coverage: test
209209
@echo "✓ Opening coverage for unit tests ..."
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
subcategory: "File Type Control Policy"
3+
layout: "zscaler"
4+
page_title: "ZIA: zia_custom_file_types"
5+
description: |-
6+
Official documentation https://help.zscaler.com/zia/about-file-type-control
7+
API documentation https://help.zscaler.com/zia/file-type-control-policy#/fileTypeRules-post
8+
Retrieves all the rules in the File Type Control policy.
9+
---
10+
11+
# zia_custom_file_types (Data Source)
12+
13+
* [Official documentation](https://help.zscaler.com/zia/about-file-type-control)
14+
* [API documentation](https://help.zscaler.com/zia/file-type-control-policy#/fileTypeRules-post)
15+
16+
Use the **zia_custom_file_types** data source to retrieves File Type Control rules.
17+
18+
## Example Usage
19+
20+
```hcl
21+
# Retrieve a File Type Control Rule by name
22+
data "zia_custom_file_types" "this" {
23+
name = "Example"
24+
}
25+
```
26+
27+
```hcl
28+
# Retrieve a File Type Control Rule by ID
29+
data "zia_custom_file_types" "this" {
30+
id = "12134558"
31+
}
32+
```
33+
34+
## Argument Reference
35+
36+
The following arguments are supported:
37+
38+
### Optional
39+
40+
* `id` - (Integer) Custom file type ID. This ID is assigned and maintained exclusively for custom file types, and this value is different from the file type ID (i.e., fileTypeId field).
41+
* `name` - (String) Custom file type name
42+
* `description` - (String) Additional information about the custom file type, if any.
43+
* `extension` - (String) Specifies the file type extension. The maximum extension length is 10 characters. Existing Zscaler extensions cannot be added to custom file types.
44+
* `file_type_id` - (Integer) File type ID. This ID is assigned and maintained for all file types including predefined and custom file types, and this value is different from the custom file type ID.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
subcategory: "File Type Control Policy"
3+
layout: "zscaler"
4+
page_title: "ZIA: zia_file_type_categories"
5+
description: |-
6+
Official documentation https://help.zscaler.com/zia/about-file-type-control
7+
API documentation https://help.zscaler.com/zia/file-type-control-policy#/fileTypeCategories-get
8+
Retrieves the list of all file type
9+
---
10+
11+
# zia_file_type_categories (Data Source)
12+
13+
* [Official documentation](https://help.zscaler.com/zia/about-file-type-control)
14+
* [API documentation](https://help.zscaler.com/zia/file-type-control-policy#/fileTypeCategories-get)
15+
16+
Use the **zia_file_type_categories** Retrieves the list of all file types, including predefined and custom file types, available for configuring rule conditions in different ZIA policies. You can retrieve predefined file types for specific file categories of policies. This datasource can be referenced within the `zia_dlp_web_rules` in the attribute `file_type_categories`
17+
18+
## Example Usage - Retrieve a File Type Category by name
19+
20+
```hcl
21+
data "zia_file_type_categories" "this1" {
22+
name = "FileType01"
23+
}
24+
```
25+
26+
## Example Usage - Retrieve a File Type Category by ID
27+
28+
```hcl
29+
data "zia_file_type_categories" "this" {
30+
id = 12134558
31+
}
32+
```
33+
34+
## Example Usage - Retrieve a File Type Category with enum filter
35+
36+
```hcl
37+
data "zia_file_type_categories" "this2" {
38+
name = "FileType01"
39+
enums = ["ZSCALERDLP"]
40+
}
41+
```
42+
43+
## Example Usage - Retrieve a File Type Category with multiple enum filters
44+
45+
```hcl
46+
data "zia_file_type_categories" "this3" {
47+
name = "FileType01"
48+
enums = ["ZSCALERDLP", "EXTERNALDLP"]
49+
}
50+
```
51+
52+
## Example Usage - Retrieve a File Type Category excluding custom file types
53+
54+
```hcl
55+
data "zia_file_type_categories" "this4" {
56+
name = "FileType01"
57+
exclude_custom_file_types = true
58+
}
59+
```
60+
61+
## Example Usage - Retrieve a File Type Category with all optional parameters
62+
63+
```hcl
64+
data "zia_file_type_categories" "this5" {
65+
name = "FileType01"
66+
enums = ["FILETYPECATEGORYFORFILETYPECONTROL"]
67+
exclude_custom_file_types = true
68+
}
69+
```
70+
71+
## Argument Reference
72+
73+
The following arguments are supported:
74+
75+
### Required
76+
77+
At least one of the following must be provided:
78+
79+
* `id` - (Integer) File type ID. This ID is assigned and maintained exclusively for custom file types, and this value is different from the file type ID (i.e., fileTypeId field).
80+
* `name` - (String) File type name. Used to search for a file type category by name.
81+
82+
### Optional
83+
84+
* `enums` - (List of Strings) Enum values to filter file types for specific policy categories. Valid values:
85+
* `ZSCALERDLP` - Filter for Zscaler DLP policy categories
86+
* `EXTERNALDLP` - Filter for External DLP policy categories
87+
* `FILETYPECATEGORYFORFILETYPECONTROL` - Filter for File Type Control policy categories
88+
89+
Multiple enum values can be specified to filter across different policy categories.
90+
91+
* `exclude_custom_file_types` - (Boolean) A Boolean value specifying whether custom file types must be excluded from the list or not. Defaults to `false`. Set to `true` to exclude custom file types and only return predefined file types.
92+
93+
## Attributes Reference
94+
95+
The following attributes are exported:
96+
97+
* `id` - (Integer) File type ID
98+
* `name` - (String) File type name
99+
* `parent` - (String) Parent category of the file type

docs/guides/release-notes.md

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

1717
---
1818

19+
## 4.6.0 (November, 19 2025)
20+
21+
### Notes
22+
23+
- Release date: **(November, 19 2025)**
24+
- Supported Terraform version: **v1.x**
25+
26+
### Enhancements
27+
28+
- [PR #495](https://github.com/zscaler/terraform-provider-zia/pull/495) - Added new data source `zia_file_type_categories`. This datasource can be referenced within the `zia_dlp_web_rules` in the attribute `file_type_categories`
29+
- [PR #495](https://github.com/zscaler/terraform-provider-zia/pull/495) - Added new data source and resource `zia_custom_file_types`
30+
- [PR #495](https://github.com/zscaler/terraform-provider-zia/pull/495) - Improved `zia_url_categories` resource READ function for better state refresh and rate limiting conservation.
31+
32+
### Bug Fixes
33+
34+
- [PR #495](https://github.com/zscaler/terraform-provider-zia/pull/495) - Upgraded to [Zscaler SDK GO v3.8.6](https://github.com/zscaler/zscaler-sdk-go/releases/tag/v3.8.6) to fix pagination in some resources.
35+
- [PR #495](https://github.com/zscaler/terraform-provider-zia/pull/495) - Fixed drift with attribute `static_location_groups` in the resource `zia_location_management`
36+
1937
## 4.5.3 (October, 17 2025)
2038

2139
### Notes
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
subcategory: "File Type Control Policy"
3+
layout: "zscaler"
4+
page_title: "ZIA: zia_custom_file_types"
5+
description: |-
6+
Official documentation https://help.zscaler.com/zia/about-file-type-control
7+
API documentation https://help.zscaler.com/zia/file-type-control-policy#/customFileTypes-get
8+
Adds a new custom file type
9+
---
10+
11+
# zia_custom_file_types (Resource)
12+
13+
* [Official documentation](https://help.zscaler.com/zia/about-file-type-control)
14+
* [API documentation](https://help.zscaler.com/zia/file-type-control-policy#/customFileTypes-get)
15+
16+
The **zia_custom_file_types** resource allows the creation and management of ZIA custom file type in the Zscaler Internet Access.
17+
18+
## Example Usage
19+
20+
```hcl
21+
resource "zia_custom_file_types" "this" {
22+
name = "FileType02"
23+
description = "FileType02"
24+
extension = "tf"
25+
}
26+
```
27+
28+
## Argument Reference
29+
30+
The following arguments are supported:
31+
32+
### Required
33+
34+
* `name` - (Required) Custom file type name
35+
* `extension` - (Required) Custom file type name
36+
37+
### Optional
38+
39+
* `description` - (Optional) Additional information about the custom file type, if any.
40+
41+
## Import
42+
43+
Zscaler offers a dedicated tool called Zscaler-Terraformer to allow the automated import of ZIA configurations into Terraform-compliant HashiCorp Configuration Language.
44+
[Visit](https://github.com/zscaler/zscaler-terraformer)
45+
46+
**zia_custom_file_types** can be imported by using `<FILE ID>` or `<FILE NAME>` as the import ID.
47+
48+
For example:
49+
50+
```shell
51+
terraform import zia_custom_file_types.example <file_id>
52+
```
53+
54+
or
55+
56+
```shell
57+
terraform import zia_custom_file_types.example <file_name>
58+
```

docs/resources/zia_dlp_web_rules.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ data "zia_dlp_engines" "this" {
107107
predefined_engine_name = "EXTERNAL"
108108
}
109109
110+
data "zia_file_type_categories" "this" {
111+
name = "FileType01"
112+
}
113+
110114
resource "zia_dlp_web_rules" "this" {
111115
name = "Example"
112116
description = "Example"
@@ -120,7 +124,7 @@ resource "zia_dlp_web_rules" "this" {
120124
user_risk_score_levels = [ "LOW", "MEDIUM", "HIGH", "CRITICAL" ]
121125
severity = "RULE_SEVERITY_HIGH"
122126
file_type_categories {
123-
id = [ 95, 116, 86, 72, 56, 119, 94, 131, 134 ]
127+
id = [ data.zia_file_type_categories.this.id ]
124128
}
125129
dlp_engines {
126130
id = [ data.zia_dlp_engines.this.id ]
@@ -396,7 +400,8 @@ The following arguments are supported:
396400
* `name` - (Optional) The name of the workload group
397401

398402
* `file_type_categories` to resource `zia_dlp_web_rules`. This attribute supports the list of file types to which the rule applies. This attribute has replaced the attribute `file_types`. Zscaler recommends updating your configurations to use the `file_type_categories` attribute in place of `file_types`. Both attributes are still supported in both the API and in this Terraform provider, but they cannot be used concurrently.
399-
* `id` - (Optional) A unique identifier assigned to the workload group
403+
* `id` - (Optional) File type category ID.
404+
**NOTE** Use the data source `zia_file_type_categories` to retrieve file type categories.
400405

401406
| Inspection Type | File Types |
402407
|:------------------------|:-----------|

docs/resources/zia_location_management.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ The following arguments are supported:
179179
### Required
180180

181181
* `name` - (Required) - Location Name.
182-
* `ip_addresses` - (Required) For locations: IP addresses of the egress points that are provisioned in the Zscaler Cloud. Each entry is a single IP address (e.g., `238.10.33.9`). For sub-locations: Egress, internal, or GRE tunnel IP addresses. Each entry is either a single IP address, CIDR (e.g., `10.10.33.0/24`), or range (e.g., `10.10.33.1-10.10.33.10`). The value is required if `vpn_credentials` are not defined.
182+
* `ip_addresses` - (Required) For locations: IP addresses of the egress points that are provisioned in the Zscaler Cloud. Each entry is a single IP address (e.g., `238.10.33.9`). For sub-locations: Egress, internal, or GRE tunnel IP addresses. Each entry is either a single IP address or range (e.g., `10.10.33.1-10.10.33.10`). The value is required if `vpn_credentials` are not defined.
183183
* `vpn_credentials`
184184
* `id` - (Optional) VPN credential resource id. The value is required if `ip_addresses` are not defined.
185185

go.mod

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/hashicorp/go-hclog v1.6.3
1111
github.com/hashicorp/terraform-plugin-sdk v1.17.2
1212
github.com/hashicorp/terraform-plugin-sdk/v2 v2.38.1
13-
github.com/zscaler/zscaler-sdk-go/v3 v3.8.1
13+
github.com/zscaler/zscaler-sdk-go/v3 v3.8.6
1414
)
1515

1616
require (
@@ -58,13 +58,13 @@ require (
5858
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
5959
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
6060
github.com/zclconf/go-cty v1.17.0 // indirect
61-
golang.org/x/crypto v0.42.0 // indirect
62-
golang.org/x/mod v0.28.0 // indirect
63-
golang.org/x/net v0.44.0 // indirect
64-
golang.org/x/sync v0.17.0 // indirect
65-
golang.org/x/sys v0.36.0 // indirect
66-
golang.org/x/text v0.30.0 // indirect
67-
golang.org/x/tools v0.37.0 // indirect
61+
golang.org/x/crypto v0.45.0 // indirect
62+
golang.org/x/mod v0.29.0 // indirect
63+
golang.org/x/net v0.47.0 // indirect
64+
golang.org/x/sync v0.18.0 // indirect
65+
golang.org/x/sys v0.38.0 // indirect
66+
golang.org/x/text v0.31.0 // indirect
67+
golang.org/x/tools v0.38.0 // indirect
6868
google.golang.org/appengine v1.6.8 // indirect
6969
google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 // indirect
7070
google.golang.org/grpc v1.75.1 // indirect

0 commit comments

Comments
 (0)