Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/unreleased/added-20250922-060300.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: added
body: Onboard new `fabric_digital_twin_builder_flow` Data Source
time: 2025-09-22T06:03:00.556439143Z
custom:
Issue: "661"
5 changes: 5 additions & 0 deletions .changes/unreleased/added-20250922-060317.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: added
body: Onboard new `fabric_digital_twin_builder_flow` Resource
time: 2025-09-22T06:03:17.007530665Z
custom:
Issue: "662"
100 changes: 100 additions & 0 deletions docs/data-sources/digital_twin_builder_flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "fabric_digital_twin_builder_flow Data Source - terraform-provider-fabric"
subcategory: ""
description: |-
The Digital Twin Builder Flow data-source allows you to retrieve details about a Fabric Digital Twin Builder Flow https://learn.microsoft.com/fabric/real-time-intelligence/digital-twin-builder/overview.
-> This data-source supports Service Principal authentication.
~> This data-source is in preview. To access it, you must explicitly enable the preview mode in the provider level configuration.
---

# fabric_digital_twin_builder_flow (Data Source)

The Digital Twin Builder Flow data-source allows you to retrieve details about a Fabric [Digital Twin Builder Flow](https://learn.microsoft.com/fabric/real-time-intelligence/digital-twin-builder/overview).

-> This data-source supports Service Principal authentication.

~> This data-source is in **preview**. To access it, you must explicitly enable the `preview` mode in the provider level configuration.

## Example Usage

```terraform
# Get item details by name
data "fabric_digital_twin_builder_flow" "example_by_name" {
display_name = "example"
workspace_id = "00000000-0000-0000-0000-000000000000"
}

# Get item details by id
data "fabric_digital_twin_builder_flow" "example_by_id" {
id = "11111111-1111-1111-1111-111111111111"
workspace_id = "00000000-0000-0000-0000-000000000000"
}

# Get item details with definition
# Examples uses `id` but `display_name` can be used as well
data "fabric_digital_twin_builder_flow" "example_definition" {
id = "11111111-1111-1111-1111-111111111111"
workspace_id = "00000000-0000-0000-0000-000000000000"
format = "Default"
output_definition = true
}

# Access the content of the definition with JSONPath expression
output "example_definition_content_jsonpath" {
value = provider::fabric::content_decode(data.fabric_digital_twin_builder_flow.example_definition.definition["definition.json"].content, ".payload.tabs[0]")
}

# Access the content of the definition as JSON object
output "example_definition_content_object" {
value = provider::fabric::content_decode(data.fabric_digital_twin_builder_flow.example_definition.definition["definition.json"].content).payload.tabs[0]
}

# This is an invalid data source
# Do not specify `id` and `display_name` in the same data source block
# data "fabric_digital_twin_builder_flow" "example" {
# display_name = "example"
# id = "11111111-1111-1111-1111-111111111111"
# workspace_id = "00000000-0000-0000-0000-000000000000"
# }
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `workspace_id` (String) The Workspace ID.

### Optional

- `display_name` (String) The Digital Twin Builder Flow display name.
- `format` (String) The Digital Twin Builder Flow format. Possible values: `Default`
- `id` (String) The Digital Twin Builder Flow ID.
- `output_definition` (Boolean) Output definition parts as gzip base64 content? Default: `false`

!> Your terraform state file may grow a lot if you output definition content. Only use it when you must use data from the definition.

- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))

### Read-Only

- `definition` (Attributes Map) Definition parts. Possible path keys: **Default** format: `definition.json` (see [below for nested schema](#nestedatt--definition))
- `description` (String) The Digital Twin Builder Flow description.

<a id="nestedatt--timeouts"></a>

### Nested Schema for `timeouts`

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

<a id="nestedatt--definition"></a>

### Nested Schema for `definition`

Read-Only:

- `content` (String) Gzip base64 content of definition part.
Use [`provider::fabric::content_decode`](../functions/content_decode.md) function to decode content.
59 changes: 59 additions & 0 deletions docs/data-sources/digital_twin_builder_flows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "fabric_digital_twin_builder_flows Data Source - terraform-provider-fabric"
subcategory: ""
description: |-
The Digital Twin Builder Flows data-source allows you to retrieve a list of Fabric Digital Twin Builder Flows https://learn.microsoft.com/fabric/real-time-intelligence/digital-twin-builder/overview.
-> This data-source supports Service Principal authentication.
~> This data-source is in preview. To access it, you must explicitly enable the preview mode in the provider level configuration.
---

# fabric_digital_twin_builder_flows (Data Source)

The Digital Twin Builder Flows data-source allows you to retrieve a list of Fabric [Digital Twin Builder Flows](https://learn.microsoft.com/fabric/real-time-intelligence/digital-twin-builder/overview).

-> This data-source supports Service Principal authentication.

~> This data-source is in **preview**. To access it, you must explicitly enable the `preview` mode in the provider level configuration.

## Example Usage

```terraform
data "fabric_digital_twin_builder_flows" "example" {
workspace_id = "00000000-0000-0000-0000-000000000000"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `workspace_id` (String) The Workspace ID.

### Optional

- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))

### Read-Only

- `values` (Attributes Set) The set of Digital Twin Builder Flows. (see [below for nested schema](#nestedatt--values))

<a id="nestedatt--timeouts"></a>

### Nested Schema for `timeouts`

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

<a id="nestedatt--values"></a>

### Nested Schema for `values`

Read-Only:

- `description` (String) The Digital Twin Builder Flow description.
- `display_name` (String) The Digital Twin Builder Flow display name.
- `id` (String) The Digital Twin Builder Flow ID.
- `workspace_id` (String) The Workspace ID.
118 changes: 118 additions & 0 deletions docs/resources/digital_twin_builder_flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "fabric_digital_twin_builder_flow Resource - terraform-provider-fabric"
subcategory: ""
description: |-
The Digital Twin Builder Flow resource allows you to manage a Fabric Digital Twin Builder Flow https://learn.microsoft.com/fabric/real-time-intelligence/digital-twin-builder/overview.
-> This resource supports Service Principal authentication.
~> This resource is in preview. To access it, you must explicitly enable the preview mode in the provider level configuration.
---

# fabric_digital_twin_builder_flow (Resource)

The Digital Twin Builder Flow resource allows you to manage a Fabric [Digital Twin Builder Flow](https://learn.microsoft.com/fabric/real-time-intelligence/digital-twin-builder/overview).

-> This resource supports Service Principal authentication.

~> This resource is in **preview**. To access it, you must explicitly enable the `preview` mode in the provider level configuration.

## Example Usage

```terraform
# Example 1 - Item without definition
resource "fabric_digital_twin_builder_flow" "example_definition" {
display_name = "example"
description = "example without definition"
workspace_id = "00000000-0000-0000-0000-000000000000"
}

# Example 2 - Item with definition bootstrapping only
resource "fabric_digital_twin_builder_flow" "example_definition_bootstrap" {
display_name = "example"
description = "example with definition bootstrapping"
workspace_id = "00000000-0000-0000-0000-000000000000"
definition_update_enabled = false
format = "Default"
definition = {
"definition.json" = {
source = "${local.path}/definition.json.tmpl"
}
}
}

# Example 3 - Item with definition update when source or tokens changed
resource "fabric_digital_twin_builder_flow" "example_definition_update" {
display_name = "example"
description = "example with definition update when source or tokens changed"
workspace_id = "00000000-0000-0000-0000-000000000000"
format = "Default"
definition = {
"definition.json" = {
source = "${local.path}/definition.json.tmpl"
tokens = {
"DIGITAL_TWIN_BUILDER_ID" = "Item ID of the parent lakehouse that exists in the workspace"
}
}
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `display_name` (String) The Digital Twin Builder Flow display name.
- `workspace_id` (String) The Workspace ID.

### Optional

- `definition` (Attributes Map) Definition parts. Read more about [Digital Twin Builder Flow definition part paths](https://learn.microsoft.com/rest/api/fabric/articles/item-management/definitions/digital-twin-builder-flow-definition). Accepted path keys: **Default** format: `definition.json` (see [below for nested schema](#nestedatt--definition))
- `definition_update_enabled` (Boolean) Update definition on change of source content. Default: `true`.
- `description` (String) The Digital Twin Builder Flow description.
- `format` (String) The Digital Twin Builder Flow format. Possible values: `Default`
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))

### Read-Only

- `id` (String) The Digital Twin Builder Flow ID.

<a id="nestedatt--definition"></a>

### Nested Schema for `definition`

Required:

- `source` (String) Path to the file with source of the definition part.

The source content may include placeholders for token substitution. Use the dot with the token name `{{ .TokenName }}`.

Optional:

- `tokens` (Map of String) A map of key/value pairs of tokens substitutes in the source.

Read-Only:

- `source_content_sha256` (String) SHA256 of source's content of definition part.

<a id="nestedatt--timeouts"></a>

### Nested Schema for `timeouts`

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

## Import

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
# terraform import fabric_digital_twin_builder_flow.example "<WorkspaceID>/<DigitalTwinBuilderFlowID>"
terraform import fabric_digital_twin_builder_flow.example "00000000-0000-0000-0000-000000000000/11111111-1111-1111-1111-111111111111"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Get item details by name
data "fabric_digital_twin_builder_flow" "example_by_name" {
display_name = "example"
workspace_id = "00000000-0000-0000-0000-000000000000"
}

# Get item details by id
data "fabric_digital_twin_builder_flow" "example_by_id" {
id = "11111111-1111-1111-1111-111111111111"
workspace_id = "00000000-0000-0000-0000-000000000000"
}

# Get item details with definition
# Examples uses `id` but `display_name` can be used as well
data "fabric_digital_twin_builder_flow" "example_definition" {
id = "11111111-1111-1111-1111-111111111111"
workspace_id = "00000000-0000-0000-0000-000000000000"
format = "Default"
output_definition = true
}

# Access the content of the definition with JSONPath expression
output "example_definition_content_jsonpath" {
value = provider::fabric::content_decode(data.fabric_digital_twin_builder_flow.example_definition.definition["definition.json"].content, ".payload.tabs[0]")
}

# Access the content of the definition as JSON object
output "example_definition_content_object" {
value = provider::fabric::content_decode(data.fabric_digital_twin_builder_flow.example_definition.definition["definition.json"].content).payload.tabs[0]
}

# This is an invalid data source
# Do not specify `id` and `display_name` in the same data source block
# data "fabric_digital_twin_builder_flow" "example" {
# display_name = "example"
# id = "11111111-1111-1111-1111-111111111111"
# workspace_id = "00000000-0000-0000-0000-000000000000"
# }
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
output "example_by_id" {
value = data.fabric_digital_twin_builder_flow.example_by_id
}

output "example_by_name" {
value = data.fabric_digital_twin_builder_flow.example_by_name
}

output "example_definition" {
value = data.fabric_digital_twin_builder_flow.example_definition
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
terraform {
required_version = ">= 1.8, < 2.0"
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.0.0" # Check for the latest version on the Terraform Registry
}
}
}

provider "fabric" {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "fabric_digital_twin_builder_flows" "example" {
workspace_id = "00000000-0000-0000-0000-000000000000"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "example" {
value = data.fabric_digital_twin_builder_flows.example
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
terraform {
required_version = ">= 1.8, < 2.0"
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.0.0" # Check for the latest version on the Terraform Registry
}
}
}

provider "fabric" {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# terraform import fabric_digital_twin_builder_flow.example "<WorkspaceID>/<DigitalTwinBuilderFlowID>"
terraform import fabric_digital_twin_builder_flow.example "00000000-0000-0000-0000-000000000000/11111111-1111-1111-1111-111111111111"
11 changes: 11 additions & 0 deletions examples/resources/fabric_digital_twin_builder_flow/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
output "example_definition" {
value = fabric_digital_twin_builder_flow.example_definition
}

output "example_definition_bootstrap" {
value = fabric_digital_twin_builder_flow.example_definition_bootstrap
}

output "example_definition_update" {
value = fabric_digital_twin_builder_flow.example_definition_update
}
Loading
Loading