-
Notifications
You must be signed in to change notification settings - Fork 16
Labels
tf/data-sourceTerraform Data-SourceTerraform Data-Source
Description
📝 Description
When I am automating and managing data analytics infrastructure using Microsoft Fabric across multiple environments, I want to get details of Maps as code in Terraform.
To consistently and securely manage Maps as code in Terraform while automating and managing data analytics infrastructure using Microsoft Fabric across multiple environments.
🔬 Details / References
- Data Source Name:
fabric_map - API documentation:
- Create: https://learn.microsoft.com/en-us/rest/api/fabric/map/items/create-map?tabs=HTTP
- Get: https://learn.microsoft.com/en-us/rest/api/fabric/map/items/get-map?tabs=HTTP
- Get Definition: https://learn.microsoft.com/en-us/rest/api/fabric/map/items/get-map-definition?tabs=HTTP
- List: https://learn.microsoft.com/en-us/rest/api/fabric/map/items/list-maps?tabs=HTTP
- Update: https://learn.microsoft.com/en-us/rest/api/fabric/map/items/update-map?tabs=HTTP
- Update Definition: https://learn.microsoft.com/en-us/rest/api/fabric/map/items/update-map-definition?tabs=HTTP
- Delete: https://learn.microsoft.com/en-us/rest/api/fabric/map/items/delete-map?tabs=HTTP
- Estimated complexity/effort: easy
- Related resources/data-sources: https://learn.microsoft.com/azure/azure-maps/
🚧 Potential Terraform Configuration / Desired Solution
# Get item details by name
data "fabric_map" "example_by_name" {
display_name = "example"
workspace_id = "00000000-0000-0000-0000-000000000000"
}
# Get item details by id
data "fabric_map" "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_map" "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_map.example_definition.definition["content.json"].content, ".payload")
}
# Access the content of the definition as JSON object
output "example_definition_content_object" {
value = provider::fabric::content_decode(data.fabric_map.example_definition.definition["content.json"].content).payload
}
# Get all items in workspace
data "fabric_maps" "example" {
workspace_id = "00000000-0000-0000-0000-000000000000"
}
# This is an invalid data source
# Do not specify `id` and `display_name` in the same data source block
# data "fabric_map" "example" {
# display_name = "example"
# id = "11111111-1111-1111-1111-111111111111"
# workspace_id = "00000000-0000-0000-0000-000000000000"
# }📎 Additional context
No response
☑️ Acceptance Criteria
No response
✅ Definition of Done
- Data Transfer Objects (DTOs)
- Data-Source Implementation
- Data-Source Added to Provider
- Unit Tests for Happy path
- Unit Tests for Error path
- Acceptance Tests
- Example in the ./examples folder
- Schema documentation in code
- Updated auto-generated provider docs with
task docs
🔰 Code of Conduct
- I agree to follow this project's Code of Conduct.
Metadata
Metadata
Assignees
Labels
tf/data-sourceTerraform Data-SourceTerraform Data-Source