Metadata Categories

A MetadataCategory defines a reusable set of Custom Metadata rules that can be assigned to folders via a folder behavior. Each category specifies named metadata keys with optional allowed-value constraints, and a set of default columns to display in the UI.

If a key's allowed_values array is empty, it is treated as a free-form text field. If the array is non-empty, the key is constrained to those values in the Web UI.

Resource Schema

Required

PropertyDescription
name
String
Name of the metadata category.

Optional

PropertyDescription
default_columns
List
Metadata keys that should appear as columns in the UI by default.

Read Only

PropertyDescription
id
Int64
Metadata Category ID
definitions
Map
Map of key names to arrays of allowed values. An empty array means free-form text.

Example Resource

resource "files_metadata_category" "example_metadata_category" {
  name            = "Approval Workflow"
  default_columns = ["Approval Status"]
}

Resource Import

This Resource supports importing using the following syntax:

Example Import Command

# Metadata Categories can be imported by specifying the id.
terraform import files_metadata_category.example_metadata_category 1

Data Source Schema

Required

PropertyDescription
id
Int64
Metadata Category ID

Read Only

PropertyDescription
name
String
Name of the metadata category.
definitions
Map
Map of key names to arrays of allowed values. An empty array means free-form text.
default_columns
List
Metadata keys that should appear as columns in the UI by default.

Example Data Source

data "files_metadata_category" "example_metadata_category" {
  id = 1
}