-
Notifications
You must be signed in to change notification settings - Fork 19
Description
🚀 Feature description
When creating and managing Fabric workspaces with Terraform, I want to programmatically create, organize, and update folders using a Terraform configuration to automate and scale the management of structured resource hierarchies and ensure consistent deployments.
🔈 Motivation
The current lack of support for a folder resource limits the ability to manage organizational structure within workspaces. This gap forces users to manually create and maintain folders outside of Infrastructure-as-Code practices, which introduces inconsistencies, delays, and errors in deployment pipelines.
🛰 Alternatives
With the release of the Folder REST API in preview, this endpoint can be called using some script (Python, PowerShell, etc.) coupled with a null_resource. This isn't ideal as errors aren't handled as eloquently as native resources.
🚧 Potential Configuration / Desired Solution
# Resource
resource "fabric_folder" "example_folder" {
display_name = "Example Folder"
workspace_id = "workspace-id"
}
# Resource with a parent_id, indicating that it is a subfolder.
resource "fabric_folder" "example_subfolder" {
display_name = "Example Folder"
parent_id = "parent-folder-id"
workspace_id = "workspace-id"
}
# Data Source example to fetch existing folder information
data "fabric_folder" "existing_folder" {
id = "existing-folder-id"
workspace_id = "workspace-id"
}📎 Additional context
Ideally, this enables the ability for any WorkspaceItem to have a folder_id property where an item can be created inside of a folder (this supposedly is now available in the item API).
☑️ Acceptance Criteria
Folder Resource Support
- Users can define a
fabric_folderresource with required properties:display_nameparent_id(optional for root-level folders)workspace_id
- Applying a plan creates the folder in the specified workspace.
- Updating the
display_nameorparent_idupdates the folder in place (when allowed by the API). - Destroying the resource deletes the folder from the workspace (assuming it contains no child resources or Terraform can handle dependencies appropriately).
Folder Data Source Support
- Terraform users can declare a data
fabric_folderblock to retrieve folder metadata usingfolder_idandworkspace_id. - The data source returns folder properties, including:
display_nameidparent_idworkspace_id
Edge Case Handling
- The provider validates the folder hierarchy (e.g., prevents circular nesting if applicable).
- Nested folder creation is supported via parent-child relationships.
🔰 Code of Conduct
- I agree to follow this project's Code of Conduct.