Skip to content

Commit

Permalink
feat(fabricitem)!: enable multi-format support
Browse files Browse the repository at this point in the history
  • Loading branch information
DariuszPorowski committed Jan 9, 2025
1 parent 1cf9dae commit 38543ed
Show file tree
Hide file tree
Showing 61 changed files with 776 additions and 180 deletions.
7 changes: 7 additions & 0 deletions .changes/unreleased/added-20241223-094847.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: added
body: |
Added support for multi-format Notebook Resource/Data-Source.
By using `format` attribute, you can now define the format of the Notebook Resource/Data-Source. Accepted values are `jpynb`, and `py`.
time: 2024-12-23T09:48:47.1324573-08:00
custom:
Issue: "168"
7 changes: 7 additions & 0 deletions .changes/unreleased/breaking-20241223-094847.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: breaking
body: |
The `format` attribute is now REQUIRED for Resources/Data-Sources with definition support.
Currently applicable to the following Resources/Data-Sources: Report, Notebook, Semantic Model, and Spark Job Definition.
time: 2024-12-23T09:48:47.1324573-08:00
custom:
Issue: "111"
4 changes: 2 additions & 2 deletions docs/data-sources/eventhouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ output "example_definition_content_object" {
### Optional

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

Expand All @@ -75,9 +76,8 @@ output "example_definition_content_object" {

### Read-Only

- `definition` (Attributes Map) Definition parts. Possible path keys: `EventhouseProperties.json`. (see [below for nested schema](#nestedatt--definition))
- `definition` (Attributes Map) Definition parts. Possible path keys: **Default** format: `EventhouseProperties.json` (see [below for nested schema](#nestedatt--definition))
- `description` (String) The Eventhouse description.
- `format` (String) The Eventhouse format. Possible values: `NotApplicable`
- `properties` (Attributes) The Eventhouse properties. (see [below for nested schema](#nestedatt--properties))

<a id="nestedatt--timeouts"></a>
Expand Down
5 changes: 3 additions & 2 deletions docs/data-sources/notebook.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ data "fabric_notebook" "example_by_id" {
data "fabric_notebook" "example_definition" {
id = "11111111-1111-1111-1111-111111111111"
workspace_id = "00000000-0000-0000-0000-000000000000"
format = "ipynb"
output_definition = true
}
Expand Down Expand Up @@ -68,6 +69,7 @@ output "example_definition_content_object" {
### Optional

- `display_name` (String) The Notebook display name.
- `format` (String) The Notebook format. Possible values: `ipynb`, `py`
- `id` (String) The Notebook ID.
- `output_definition` (Boolean) Output definition parts as gzip base64 content? Default: `false`

Expand All @@ -77,9 +79,8 @@ output "example_definition_content_object" {

### Read-Only

- `definition` (Attributes Map) Definition parts. Possible path keys: `notebook-content.ipynb`. (see [below for nested schema](#nestedatt--definition))
- `definition` (Attributes Map) Definition parts. Possible path keys: **ipynb** format: `notebook-content.ipynb` **py** format: `notebook-content.py` (see [below for nested schema](#nestedatt--definition))
- `description` (String) The Notebook description.
- `format` (String) The Notebook format. Possible values: `ipynb`.

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

Expand Down
5 changes: 3 additions & 2 deletions docs/data-sources/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ data "fabric_report" "example" {
data "fabric_report" "example_definition" {
id = "11111111-1111-1111-1111-111111111111"
workspace_id = "00000000-0000-0000-0000-000000000000"
format = "PBIR-Legacy"
output_definition = true
}
Expand Down Expand Up @@ -56,6 +57,7 @@ output "example_definition_report_object" {

### Optional

- `format` (String) The Report format. Possible values: `PBIR-Legacy`, `PBIR`
- `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.
Expand All @@ -64,10 +66,9 @@ output "example_definition_report_object" {

### Read-Only

- `definition` (Attributes Map) Definition parts. Possible path keys: `report.json`, `definition.pbir`, `StaticResources/RegisteredResources/*`, `StaticResources/SharedResources/*`. (see [below for nested schema](#nestedatt--definition))
- `definition` (Attributes Map) Definition parts. Possible path keys: **PBIR-Legacy** format: `StaticResources/RegisteredResources/*`, `StaticResources/SharedResources/*`, `definition.pbir`, `report.json` **PBIR** format: `StaticResources/RegisteredResources/*`, `StaticResources/SharedResources/*`, `definition.pbir`, `definition/pages/*.json`, `definition/report.json`, `definition/version.json` (see [below for nested schema](#nestedatt--definition))
- `description` (String) The Report description.
- `display_name` (String) The Report display name.
- `format` (String) The Report format. Possible values: `PBIR-Legacy`.

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

Expand Down
5 changes: 3 additions & 2 deletions docs/data-sources/semantic_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ data "fabric_semantic_model" "example" {
data "fabric_semantic_model" "example_definition" {
id = "11111111-1111-1111-1111-111111111111"
workspace_id = "00000000-0000-0000-0000-000000000000"
format = "TMSL"
output_definition = true
}
Expand All @@ -53,6 +54,7 @@ output "example_definition_bim_object" {

### Optional

- `format` (String) The Semantic Model format. Possible values: `TMSL`, `TMDL`
- `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.
Expand All @@ -61,10 +63,9 @@ output "example_definition_bim_object" {

### Read-Only

- `definition` (Attributes Map) Definition parts. Possible path keys: `model.bim`, `definition.pbism`, `diagramLayout.json`. (see [below for nested schema](#nestedatt--definition))
- `definition` (Attributes Map) Definition parts. Possible path keys: **TMSL** format: `definition.pbism`, `diagramLayp.json`, `model.bim` **TMDL** format: `definition.pbism`, `definition/database.tmdl`, `definition/model.tmdl`, `definition/tables/*.tmdl`, `diagramLayp.json` (see [below for nested schema](#nestedatt--definition))
- `description` (String) The Semantic Model description.
- `display_name` (String) The Semantic Model display name.
- `format` (String) The Semantic Model format. Possible values: `TMSL`.

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

Expand Down
5 changes: 3 additions & 2 deletions docs/data-sources/spark_job_definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ data "fabric_spark_job_definition" "example_by_name" {
data "fabric_spark_job_definition" "example_definition" {
id = "11111111-1111-1111-1111-111111111111"
workspace_id = "00000000-0000-0000-0000-000000000000"
format = "SparkJobDefinitionV1"
output_definition = true
}
Expand Down Expand Up @@ -68,6 +69,7 @@ output "example_definition_content_object" {
### Optional

- `display_name` (String) The Spark Job Definition display name.
- `format` (String) The Spark Job Definition format. Possible values: `SparkJobDefinitionV1`
- `id` (String) The Spark Job Definition ID.
- `output_definition` (Boolean) Output definition parts as gzip base64 content? Default: `false`

Expand All @@ -77,9 +79,8 @@ output "example_definition_content_object" {

### Read-Only

- `definition` (Attributes Map) Definition parts. Possible path keys: `SparkJobDefinitionV1.json`. (see [below for nested schema](#nestedatt--definition))
- `definition` (Attributes Map) Definition parts. Possible path keys: **SparkJobDefinitionV1** format: `SparkJobDefinitionV1.json` (see [below for nested schema](#nestedatt--definition))
- `description` (String) The Spark Job Definition description.
- `format` (String) The Spark Job Definition format. Possible values: `SparkJobDefinitionV1`.
- `properties` (Attributes) The Spark Job Definition properties. (see [below for nested schema](#nestedatt--properties))

<a id="nestedatt--timeouts"></a>
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/data_pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ resource "fabric_data_pipeline" "example_definition_update" {

### Optional

- `definition` (Attributes Map) Definition parts. Accepted path keys: `pipeline-content.json`. Read more about [Data Pipeline definition part paths](https://learn.microsoft.com/fabric/data-factory/pipeline-rest-api). (see [below for nested schema](#nestedatt--definition))
- `definition` (Attributes Map) Definition parts. Read more about [Data Pipeline definition part paths](https://learn.microsoft.com/fabric/data-factory/pipeline-rest-api). Accepted path keys: **Default** format: `pipeline-content.json` (see [below for nested schema](#nestedatt--definition))
- `definition_update_enabled` (Boolean) Update definition on change of source content. Default: `true`.
- `description` (String) The Data Pipeline description.
- `format` (String) The Data Pipeline format. Possible values: `Default`
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))

### Read-Only

- `format` (String) The Data Pipeline format. Possible values: `NotApplicable`
- `id` (String) The Data Pipeline ID.

<a id="nestedatt--definition"></a>
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/eventhouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ resource "fabric_eventhouse" "example_definition_update" {

### Optional

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

### Read-Only

- `format` (String) The Eventhouse format. Possible values: `NotApplicable`
- `id` (String) The Eventhouse ID.
- `properties` (Attributes) The Eventhouse properties. (see [below for nested schema](#nestedatt--properties))

Expand Down
6 changes: 4 additions & 2 deletions docs/resources/notebook.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ resource "fabric_notebook" "example_definition_bootstrap" {
description = "example with definition bootstrapping"
workspace_id = "00000000-0000-0000-0000-000000000000"
definition_update_enabled = false
format = "ipynb"
definition = {
"notebook-content.ipynb" = {
source = "${local.path}/notebook.ipynb.tmpl"
Expand All @@ -43,6 +44,7 @@ resource "fabric_notebook" "example_definition_update" {
display_name = "example"
description = "example with definition update when source or tokens changed"
workspace_id = "00000000-0000-0000-0000-000000000000"
format = "ipynb"
definition = {
"notebook-content.ipynb" = {
source = "${local.path}/notebook.ipynb.tmpl"
Expand All @@ -65,14 +67,14 @@ resource "fabric_notebook" "example_definition_update" {

### Optional

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

### Read-Only

- `format` (String) The Notebook format. Possible values: `ipynb`.
- `id` (String) The Notebook ID.

<a id="nestedatt--definition"></a>
Expand Down
6 changes: 4 additions & 2 deletions docs/resources/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ resource "fabric_report" "example_bootstrap" {
display_name = "example"
workspace_id = "00000000-0000-0000-0000-000000000000"
definition_update_enabled = false
format = "PBIR-Legacy"
definition = {
"report.json" = {
source = "${local.path}/report.json"
Expand All @@ -44,6 +45,7 @@ resource "fabric_report" "example_bootstrap" {
resource "fabric_report" "example_update" {
display_name = "example with update"
workspace_id = "00000000-0000-0000-0000-000000000000"
format = "PBIR-Legacy"
definition = {
"report.json" = {
source = "${local.path}/report.json"
Expand All @@ -66,8 +68,9 @@ resource "fabric_report" "example_update" {

### Required

- `definition` (Attributes Map) Definition parts. Accepted path keys: `report.json`, `definition.pbir`, `StaticResources/RegisteredResources/*`, `StaticResources/SharedResources/*`. Read more about [Report definition part paths](https://learn.microsoft.com/rest/api/fabric/articles/item-management/definitions/report-definition). (see [below for nested schema](#nestedatt--definition))
- `definition` (Attributes Map) Definition parts. Read more about [Report definition part paths](https://learn.microsoft.com/rest/api/fabric/articles/item-management/definitions/report-definition). Accepted path keys: **PBIR** format: `StaticResources/RegisteredResources/*`, `StaticResources/SharedResources/*`, `definition.pbir`, `definition/pages/*.json`, `definition/report.json`, `definition/version.json` **PBIR-Legacy** format: `StaticResources/RegisteredResources/*`, `StaticResources/SharedResources/*`, `definition.pbir`, `report.json` (see [below for nested schema](#nestedatt--definition))
- `display_name` (String) The Report display name.
- `format` (String) The Report format. Possible values: `PBIR-Legacy`, `PBIR`
- `workspace_id` (String) The Workspace ID.

### Optional
Expand All @@ -78,7 +81,6 @@ resource "fabric_report" "example_update" {

### Read-Only

- `format` (String) The Report format. Possible values: `PBIR-Legacy`.
- `id` (String) The Report ID.

<a id="nestedatt--definition"></a>
Expand Down
6 changes: 4 additions & 2 deletions docs/resources/semantic_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ resource "fabric_semantic_model" "example_bootstrap" {
display_name = "example"
workspace_id = "00000000-0000-0000-0000-000000000000"
definition_update_enabled = false
format = "TMSL"
definition = {
"model.bim" = {
source = "${local.path}/model.bim.tmpl"
Expand All @@ -38,6 +39,7 @@ resource "fabric_semantic_model" "example_bootstrap" {
resource "fabric_semantic_model" "example_update" {
display_name = "example with update"
workspace_id = "00000000-0000-0000-0000-000000000000"
format = "TMSL"
definition = {
"model.bim" = {
source = "${local.path}/model.bim.tmpl"
Expand All @@ -57,8 +59,9 @@ resource "fabric_semantic_model" "example_update" {

### Required

- `definition` (Attributes Map) Definition parts. Accepted path keys: `model.bim`, `definition.pbism`, `diagramLayout.json`. Read more about [Semantic Model definition part paths](https://learn.microsoft.com/rest/api/fabric/articles/item-management/definitions/semantic-model-definition). (see [below for nested schema](#nestedatt--definition))
- `definition` (Attributes Map) Definition parts. Read more about [Semantic Model definition part paths](https://learn.microsoft.com/rest/api/fabric/articles/item-management/definitions/semantic-model-definition). Accepted path keys: **TMSL** format: `definition.pbism`, `diagramLayp.json`, `model.bim` **TMDL** format: `definition.pbism`, `definition/database.tmdl`, `definition/model.tmdl`, `definition/tables/*.tmdl`, `diagramLayp.json` (see [below for nested schema](#nestedatt--definition))
- `display_name` (String) The Semantic Model display name.
- `format` (String) The Semantic Model format. Possible values: `TMSL`, `TMDL`
- `workspace_id` (String) The Workspace ID.

### Optional
Expand All @@ -69,7 +72,6 @@ resource "fabric_semantic_model" "example_update" {

### Read-Only

- `format` (String) The Semantic Model format. Possible values: `TMSL`.
- `id` (String) The Semantic Model ID.

<a id="nestedatt--definition"></a>
Expand Down
6 changes: 4 additions & 2 deletions docs/resources/spark_job_definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ resource "fabric_spark_job_definition" "example_definition_bootstrap" {
description = "example with definition bootstrapping"
workspace_id = "00000000-0000-0000-0000-000000000000"
definition_update_enabled = false
format = "SparkJobDefinitionV1"
definition = {
"SparkJobDefinitionV1.json" = {
source = "${local.path}/SparkJobDefinitionV1.json.tmpl"
Expand All @@ -43,6 +44,7 @@ resource "fabric_spark_job_definition" "example_definition_update" {
display_name = "example3"
description = "example with definition update when source or tokens changed"
workspace_id = "00000000-0000-0000-0000-000000000000"
format = "SparkJobDefinitionV1"
definition = {
"SparkJobDefinitionV1.json" = {
source = "${local.path}/SparkJobDefinitionV1.json.tmpl"
Expand All @@ -65,14 +67,14 @@ resource "fabric_spark_job_definition" "example_definition_update" {

### Optional

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

### Read-Only

- `format` (String) The Spark Job Definition format. Possible values: `SparkJobDefinitionV1`.
- `id` (String) The Spark Job Definition ID.
- `properties` (Attributes) The Spark Job Definition properties. (see [below for nested schema](#nestedatt--properties))

Expand Down
1 change: 1 addition & 0 deletions examples/data-sources/fabric_notebook/data-source.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ data "fabric_notebook" "example_by_id" {
data "fabric_notebook" "example_definition" {
id = "11111111-1111-1111-1111-111111111111"
workspace_id = "00000000-0000-0000-0000-000000000000"
format = "ipynb"
output_definition = true
}

Expand Down
1 change: 1 addition & 0 deletions examples/data-sources/fabric_report/data-source.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ data "fabric_report" "example" {
data "fabric_report" "example_definition" {
id = "11111111-1111-1111-1111-111111111111"
workspace_id = "00000000-0000-0000-0000-000000000000"
format = "PBIR-Legacy"
output_definition = true
}

Expand Down
1 change: 1 addition & 0 deletions examples/data-sources/fabric_semantic_model/data-source.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ data "fabric_semantic_model" "example" {
data "fabric_semantic_model" "example_definition" {
id = "11111111-1111-1111-1111-111111111111"
workspace_id = "00000000-0000-0000-0000-000000000000"
format = "TMSL"
output_definition = true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ data "fabric_spark_job_definition" "example_by_name" {
data "fabric_spark_job_definition" "example_definition" {
id = "11111111-1111-1111-1111-111111111111"
workspace_id = "00000000-0000-0000-0000-000000000000"
format = "SparkJobDefinitionV1"
output_definition = true
}

Expand Down
2 changes: 2 additions & 0 deletions examples/resources/fabric_notebook/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ resource "fabric_notebook" "example_definition_bootstrap" {
description = "example with definition bootstrapping"
workspace_id = "00000000-0000-0000-0000-000000000000"
definition_update_enabled = false
format = "ipynb"
definition = {
"notebook-content.ipynb" = {
source = "${local.path}/notebook.ipynb.tmpl"
Expand All @@ -22,6 +23,7 @@ resource "fabric_notebook" "example_definition_update" {
display_name = "example"
description = "example with definition update when source or tokens changed"
workspace_id = "00000000-0000-0000-0000-000000000000"
format = "ipynb"
definition = {
"notebook-content.ipynb" = {
source = "${local.path}/notebook.ipynb.tmpl"
Expand Down
Loading

0 comments on commit 38543ed

Please sign in to comment.