-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(kql_queryset): onboard resource and add definition (#217)
# 📥 Pull Request close #130 close #131 ## ❓ What are you trying to address - Onboard new resource: `fabric_kql_queryset` - Add definition support to the `fabric_kql_queryset` Data-Source
- Loading branch information
1 parent
aef565f
commit b10f459
Showing
18 changed files
with
713 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
kind: added | ||
body: "New Resource: `fabric_kql_queryset`" | ||
time: 2025-01-25T14:52:44.1990994+01:00 | ||
custom: | ||
Issue: "130" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
kind: added | ||
body: Definition support in the `fabric_kql_queryset` Data-Source | ||
time: 2025-01-25T14:53:41.6482592+01:00 | ||
custom: | ||
Issue: "131" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "fabric_kql_queryset Resource - terraform-provider-fabric" | ||
subcategory: "" | ||
description: |- | ||
Manage a Fabric KQL Queryset. | ||
Use this resource to manage KQL Queryset https://learn.microsoft.com/fabric/real-time-intelligence/kusto-query-set. | ||
-> This item 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_kql_queryset (Resource) | ||
|
||
Manage a Fabric KQL Queryset. | ||
|
||
Use this resource to manage [KQL Queryset](https://learn.microsoft.com/fabric/real-time-intelligence/kusto-query-set). | ||
|
||
-> This item 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_kql_queryset" "example" { | ||
display_name = "example" | ||
workspace_id = "00000000-0000-0000-0000-000000000000" | ||
} | ||
# Example 2 - Item with definition bootstrapping only | ||
resource "fabric_kql_queryset" "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 = { | ||
"RealTimeQueryset.json" = { | ||
source = "${local.path}/RealTimeQueryset.json" | ||
} | ||
} | ||
} | ||
# Example 3 - Item with definition update when source or tokens changed | ||
resource "fabric_kql_queryset" "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 = { | ||
"RealTimeQueryset.json" = { | ||
source = "${local.path}/RealTimeQueryset.json.tmpl" | ||
tokens = { | ||
"MyValue1" = "my value 1" | ||
"MyValue2" = "my value 2" | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `display_name` (String) The KQL Queryset display name. | ||
- `workspace_id` (String) The Workspace ID. | ||
|
||
### Optional | ||
|
||
- `definition` (Attributes Map) Definition parts. Read more about [KQL Queryset definition part paths](https://learn.microsoft.com/rest/api/fabric/articles/item-management/definitions/kql-queryset-definition). Accepted path keys: **Default** format: `RealTimeQueryset.json` (see [below for nested schema](#nestedatt--definition)) | ||
- `definition_update_enabled` (Boolean) Update definition on change of source content. Default: `true`. | ||
- `description` (String) The KQL Queryset description. | ||
- `format` (String) The KQL Queryset format. Possible values: `Default` | ||
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts)) | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The KQL Queryset 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: | ||
|
||
```shell | ||
# terraform import fabric_kql_queryset.example "<WorkspaceID>/<KQLQuerysetID>" | ||
terraform import fabric_kql_queryset.example "00000000-0000-0000-0000-000000000000/11111111-1111-1111-1111-111111111111" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# terraform import fabric_kql_queryset.example "<WorkspaceID>/<KQLQuerysetID>" | ||
terraform import fabric_kql_queryset.example "00000000-0000-0000-0000-000000000000/11111111-1111-1111-1111-111111111111" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
output "example" { | ||
value = resource.fabric_kql_queryset.example | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Example 1 - Item without definition | ||
resource "fabric_kql_queryset" "example" { | ||
display_name = "example" | ||
workspace_id = "00000000-0000-0000-0000-000000000000" | ||
} | ||
|
||
# Example 2 - Item with definition bootstrapping only | ||
resource "fabric_kql_queryset" "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 = { | ||
"RealTimeQueryset.json" = { | ||
source = "${local.path}/RealTimeQueryset.json" | ||
} | ||
} | ||
} | ||
|
||
# Example 3 - Item with definition update when source or tokens changed | ||
resource "fabric_kql_queryset" "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 = { | ||
"RealTimeQueryset.json" = { | ||
source = "${local.path}/RealTimeQueryset.json.tmpl" | ||
tokens = { | ||
"MyValue1" = "my value 1" | ||
"MyValue2" = "my value 2" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.