Skip to content

Commit

Permalink
feat(activator): onboard new resource/data-source (#256)
Browse files Browse the repository at this point in the history
# 📥 Pull Request

## ❓ What are you trying to address

- Add new resource `fabric_activator`
- Add new data-source `fabric_activator`
- Add new data-source `fabric_activators`
- Fix: missing preview note in data-source lists documentation
- Misc: simplifies the code for IsPreviewMode
  • Loading branch information
DariuszPorowski authored Feb 27, 2025
1 parent 81b8c38 commit 735f93a
Show file tree
Hide file tree
Showing 46 changed files with 1,781 additions and 85 deletions.
5 changes: 5 additions & 0 deletions .changes/unreleased/added-20250214-122903.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: added
body: Onboard new resource/data-source `fabric_activator` (also known as reflex).
time: 2025-02-14T12:29:03.2906058+01:00
custom:
Issue: "256"
5 changes: 5 additions & 0 deletions .changes/unreleased/fixed-20250214-123021.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: fixed
body: Missing preview note in list data-sources
time: 2025-02-14T12:30:21.0523343+01:00
custom:
Issue: "256"
103 changes: 103 additions & 0 deletions docs/data-sources/activator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "fabric_activator Data Source - terraform-provider-fabric"
subcategory: ""
description: |-
Get a Fabric Activator (also known as Reflex).
Use this data source to fetch a Activator https://learn.microsoft.com/fabric/real-time-intelligence/event-streams/add-destination-activator.
-> This item does not support Service Principal. Please use a User context authentication.
~> This data-source is in preview. To access it, you must explicitly enable the preview mode in the provider level configuration.
---

# fabric_activator (Data Source)

Get a Fabric Activator (also known as Reflex).

Use this data source to fetch a [Activator](https://learn.microsoft.com/fabric/real-time-intelligence/event-streams/add-destination-activator).

-> This item does not support Service Principal. Please use a User context 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_activator" "example_by_name" {
display_name = "example"
workspace_id = "00000000-0000-0000-0000-000000000000"
}
# Get item details by id
data "fabric_activator" "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_activator" "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_activator.example_definition.definition["ReflexEntities.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_activator.example_definition.definition["ReflexEntities.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_activator" "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 Activator display name.
- `format` (String) The Activator format. Possible values: `Default`
- `id` (String) The Activator 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: `ReflexEntities.json` (see [below for nested schema](#nestedatt--definition))
- `description` (String) The Activator 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.
62 changes: 62 additions & 0 deletions docs/data-sources/activators.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "fabric_activators Data Source - terraform-provider-fabric"
subcategory: ""
description: |-
List a Fabric Activators (also known as Reflex).
Use this data source to list Activators https://learn.microsoft.com/fabric/real-time-intelligence/event-streams/add-destination-activator.
-> This item does not support Service Principal. Please use a User context authentication.
~> This data-source is in preview. To access it, you must explicitly enable the preview mode in the provider level configuration.
---

# fabric_activators (Data Source)

List a Fabric Activators (also known as Reflex).

Use this data source to list [Activators](https://learn.microsoft.com/fabric/real-time-intelligence/event-streams/add-destination-activator).

-> This item does not support Service Principal. Please use a User context 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_activators" "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 List) The list of Activators. (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 Activator description.
- `display_name` (String) The Activator display name.
- `id` (String) The Activator ID.
- `workspace_id` (String) The Workspace ID.
3 changes: 3 additions & 0 deletions docs/data-sources/data_pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: |-
List a Fabric Data Pipelines.
Use this data source to list Data Pipelines https://learn.microsoft.com/fabric/data-factory/data-factory-overview#data-pipelines.
-> This item does not support Service Principal. Please use a User context authentication.
~> This data-source is in preview. To access it, you must explicitly enable the preview mode in the provider level configuration.
---

# fabric_data_pipelines (Data Source)
Expand All @@ -16,6 +17,8 @@ Use this data source to list [Data Pipelines](https://learn.microsoft.com/fabric

-> This item does not support Service Principal. Please use a User context 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
Expand Down
3 changes: 3 additions & 0 deletions docs/data-sources/eventstreams.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: |-
List a Fabric Eventstreams.
Use this data source to list Eventstreams https://learn.microsoft.com/fabric/real-time-intelligence/event-streams/overview.
-> This item 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_eventstreams (Data Source)
Expand All @@ -16,6 +17,8 @@ Use this data source to list [Eventstreams](https://learn.microsoft.com/fabric/r

-> This item 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
Expand Down
3 changes: 3 additions & 0 deletions docs/data-sources/graphql_apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: |-
List a Fabric GraphQL APIs.
Use this data source to list GraphQL APIs https://learn.microsoft.com/fabric/data-engineering/api-graphql-overview.
-> This item 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_graphql_apis (Data Source)
Expand All @@ -16,6 +17,8 @@ Use this data source to list [GraphQL APIs](https://learn.microsoft.com/fabric/d

-> This item 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
Expand Down
3 changes: 3 additions & 0 deletions docs/data-sources/kql_querysets.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: |-
List a Fabric KQL Querysets.
Use this data source to list KQL Querysets https://learn.microsoft.com/fabric/real-time-intelligence/kusto-query-set.
-> This item 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_kql_querysets (Data Source)
Expand All @@ -16,6 +17,8 @@ Use this data source to list [KQL Querysets](https://learn.microsoft.com/fabric/

-> This item 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
Expand Down
3 changes: 3 additions & 0 deletions docs/data-sources/mirrored_warehouses.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: |-
List a Fabric Mirrored Warehouses.
Use this data source to list Mirrored Warehouses https://learn.microsoft.com/fabric/database/mirrored-database/overview.
-> This item does not support Service Principal. Please use a User context authentication.
~> This data-source is in preview. To access it, you must explicitly enable the preview mode in the provider level configuration.
---

# fabric_mirrored_warehouses (Data Source)
Expand All @@ -16,6 +17,8 @@ Use this data source to list [Mirrored Warehouses](https://learn.microsoft.com/f

-> This item does not support Service Principal. Please use a User context 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
Expand Down
3 changes: 3 additions & 0 deletions docs/data-sources/ml_experiments.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: |-
List a Fabric ML Experiments.
Use this data source to list ML Experiments https://learn.microsoft.com/fabric/data-science/machine-learning-experiment.
-> This item does not support Service Principal. Please use a User context authentication.
~> This data-source is in preview. To access it, you must explicitly enable the preview mode in the provider level configuration.
---

# fabric_ml_experiments (Data Source)
Expand All @@ -16,6 +17,8 @@ Use this data source to list [ML Experiments](https://learn.microsoft.com/fabric

-> This item does not support Service Principal. Please use a User context 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
Expand Down
3 changes: 3 additions & 0 deletions docs/data-sources/ml_models.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: |-
List a Fabric ML Models.
Use this data source to list ML Models https://learn.microsoft.com/fabric/data-science/machine-learning-model.
-> This item does not support Service Principal. Please use a User context authentication.
~> This data-source is in preview. To access it, you must explicitly enable the preview mode in the provider level configuration.
---

# fabric_ml_models (Data Source)
Expand All @@ -16,6 +17,8 @@ Use this data source to list [ML Models](https://learn.microsoft.com/fabric/data

-> This item does not support Service Principal. Please use a User context 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
Expand Down
3 changes: 3 additions & 0 deletions docs/data-sources/paginated_reports.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: |-
List a Fabric Paginated Reports.
Use this data source to list Paginated Reports https://learn.microsoft.com/power-bi/paginated-reports/web-authoring/get-started-paginated-formatted-table.
-> This item does not support Service Principal. Please use a User context authentication.
~> This data-source is in preview. To access it, you must explicitly enable the preview mode in the provider level configuration.
---

# fabric_paginated_reports (Data Source)
Expand All @@ -16,6 +17,8 @@ Use this data source to list [Paginated Reports](https://learn.microsoft.com/pow

-> This item does not support Service Principal. Please use a User context 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
Expand Down
3 changes: 3 additions & 0 deletions docs/data-sources/sql_endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: |-
List a Fabric SQL Endpoints.
Use this data source to list SQL Endpoints https://learn.microsoft.com/fabric/data-warehouse/data-warehousing#sql-analytics-endpoint-of-the-lakehouse.
-> This item does not support Service Principal. Please use a User context authentication.
~> This data-source is in preview. To access it, you must explicitly enable the preview mode in the provider level configuration.
---

# fabric_sql_endpoints (Data Source)
Expand All @@ -16,6 +17,8 @@ Use this data source to list [SQL Endpoints](https://learn.microsoft.com/fabric/

-> This item does not support Service Principal. Please use a User context 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
Expand Down
Loading

0 comments on commit 735f93a

Please sign in to comment.