|
| 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 |
0 commit comments