Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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-20251012-225400.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: added
body: Onboard new `fabric_tag` Data Source
time: 2025-10-12T22:54:00.605805004Z
custom:
Issue: "678"
5 changes: 5 additions & 0 deletions .changes/unreleased/added-20251012-225416.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: added
body: Onboard new `fabric_tag` Resource
time: 2025-10-12T22:54:16.492640044Z
custom:
Issue: "679"
66 changes: 66 additions & 0 deletions docs/data-sources/tag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "fabric_tag Data Source - terraform-provider-fabric"
subcategory: ""
description: |-
The Tag data-source allows you to retrieve details about a Fabric Tag https://learn.microsoft.com/fabric/governance/tags-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_tag (Data Source)

The Tag data-source allows you to retrieve details about a Fabric [Tag](https://learn.microsoft.com/fabric/governance/tags-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_tag" "example_by_id" {
id = "11111111-1111-1111-1111-111111111111"
}

data "fabric_tag" "example_by_name" {
display_name = "example"
}

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

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

### Optional

- `display_name` (String) The Tag display name.
- `id` (String) The Tag ID.
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))

### Read-Only

- `scope` (Attributes) Represents a tag scope. (see [below for nested schema](#nestedatt--scope))

<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--scope"></a>

### Nested Schema for `scope`

Read-Only:

- `domain_id` (String) Domain ID.
- `type` (String) Scope Type. Value must be one of : `Domain`, `Tenant`.
62 changes: 62 additions & 0 deletions docs/data-sources/tags.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_tags Data Source - terraform-provider-fabric"
subcategory: ""
description: |-
The Tags data-source allows you to retrieve a list of Fabric Tags https://learn.microsoft.com/fabric/governance/tags-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_tags (Data Source)

The Tags data-source allows you to retrieve a list of Fabric [Tags](https://learn.microsoft.com/fabric/governance/tags-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_tags" "example" {
}
```

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

### Optional

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

### Read-Only

- `values` (Attributes Set) The set of Tags. (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:

- `display_name` (String) The Tag display name.
- `id` (String) The Tag ID.
- `scope` (Attributes) Represents a tag scope. (see [below for nested schema](#nestedatt--values--scope))

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

### Nested Schema for `values.scope`

Read-Only:

- `domain_id` (String) Domain ID.
- `type` (String) Scope Type. Value must be one of : `Domain`, `Tenant`.
78 changes: 78 additions & 0 deletions docs/resources/tag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "fabric_tag Resource - terraform-provider-fabric"
subcategory: ""
description: |-
The Tag resource allows you to manage a Fabric Tag https://learn.microsoft.com/fabric/governance/tags-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_tag (Resource)

The Tag resource allows you to manage a Fabric [Tag](https://learn.microsoft.com/fabric/governance/tags-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 with default scope (Tenant)
resource "fabric_tag" "example" {
create_tags_request = [
{
display_name = "example"
},
{
display_name = "example2"
}
]
}
```

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

### Required

- `tags` (Attributes Set) List of tags associated with the resource. (see [below for nested schema](#nestedatt--tags))

### Optional

- `display_name` (String) The Tag display name. String length must be at most 40.
- `scope` (Attributes) Represents a tag scope. (see [below for nested schema](#nestedatt--scope))
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))

### Read-Only

- `id` (String) The Tag ID.

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

### Nested Schema for `tags`

Required:

- `display_name` (String) The Tag display name.

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

### Nested Schema for `scope`

Optional:

- `domain_id` (String) Domain ID.
- `type` (String) Scope Type. Value must be one of : `Domain`, `Tenant`.

<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).
14 changes: 14 additions & 0 deletions examples/data-sources/fabric_tag/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
data "fabric_tag" "example_by_id" {
id = "11111111-1111-1111-1111-111111111111"
}

data "fabric_tag" "example_by_name" {
display_name = "example"
}

# This is an invalid data source
# Do not specify `id` and `display_name` in the same data source block
# data "fabric_tag" "example" {
# display_name = "example"
# id = "11111111-1111-1111-1111-111111111111"
# }
7 changes: 7 additions & 0 deletions examples/data-sources/fabric_tag/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
output "example_by_id" {
value = data.fabric_tag.example_by_id
}

output "example_by_name" {
value = data.fabric_tag.example_by_name
}
11 changes: 11 additions & 0 deletions examples/data-sources/fabric_tag/providers.tf
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" {}
2 changes: 2 additions & 0 deletions examples/data-sources/fabric_tags/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
data "fabric_tags" "example" {
}
3 changes: 3 additions & 0 deletions examples/data-sources/fabric_tags/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "example" {
value = data.fabric_tags.example
}
11 changes: 11 additions & 0 deletions examples/data-sources/fabric_tags/providers.tf
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" {}
3 changes: 3 additions & 0 deletions examples/resources/fabric_tag/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "example" {
value = fabric_tag.example
}
11 changes: 11 additions & 0 deletions examples/resources/fabric_tag/providers.tf
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" {}
11 changes: 11 additions & 0 deletions examples/resources/fabric_tag/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#Example with default scope (Tenant)
resource "fabric_tag" "example" {
create_tags_request = [
{
display_name = "example"
},
{
display_name = "example2"
}
]
}
4 changes: 4 additions & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ import (
"github.com/microsoft/terraform-provider-fabric/internal/services/sparkwssettings"
"github.com/microsoft/terraform-provider-fabric/internal/services/sqldatabase"
"github.com/microsoft/terraform-provider-fabric/internal/services/sqlendpoint"
"github.com/microsoft/terraform-provider-fabric/internal/services/tags"
"github.com/microsoft/terraform-provider-fabric/internal/services/variablelibrary"
"github.com/microsoft/terraform-provider-fabric/internal/services/warehouse"
"github.com/microsoft/terraform-provider-fabric/internal/services/warehousesnapshot"
Expand Down Expand Up @@ -459,6 +460,7 @@ func (p *FabricProvider) Resources(ctx context.Context) []func() resource.Resour
sparkwssettings.NewResourceSparkWorkspaceSettings,
sparkjobdefinition.NewResourceSparkJobDefinition,
sqldatabase.NewResourceSQLDatabase,
tags.NewResourceTag,
variablelibrary.NewResourceVariableLibrary,
warehouse.NewResourceWarehouse,
warehousesnapshot.NewResourceWarehouseSnapshot,
Expand Down Expand Up @@ -532,6 +534,8 @@ func (p *FabricProvider) DataSources(ctx context.Context) []func() datasource.Da
shortcut.NewDataSourceShortcut,
shortcut.NewDataSourceShortcuts,
paginatedreport.NewDataSourcePaginatedReports,
tags.NewDataSourceTags,
tags.NewDataSourceTag,
activator.NewDataSourceActivator,
activator.NewDataSourceActivators,
report.NewDataSourceReport,
Expand Down
15 changes: 15 additions & 0 deletions internal/services/tags/base.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package tags

import (
"github.com/microsoft/terraform-provider-fabric/internal/pkg/tftypeinfo"
)

var ItemTypeInfo = tftypeinfo.TFTypeInfo{ //nolint:gochecknoglobals
Name: "Tag",
Type: "tag",
Names: "Tags",
Types: "tags",
DocsURL: "https://learn.microsoft.com/fabric/governance/tags-overview",
IsPreview: true,
IsSPNSupported: true,
}
10 changes: 10 additions & 0 deletions internal/services/tags/base_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright (c) Microsoft Corporation
// SPDX-License-Identifier: MPL-2.0

package tags_test

import (
"github.com/microsoft/terraform-provider-fabric/internal/services/tags"
)

var itemTypeInfo = tags.ItemTypeInfo
Loading
Loading