Skip to content
This repository has been archived by the owner on Jun 19, 2021. It is now read-only.

Commit

Permalink
Fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kostyaplis committed Jan 13, 2020
1 parent 9aa2277 commit c010c0d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
32 changes: 16 additions & 16 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ resource "local_file" "json_card" {
for_each = restapi_object.cards
filename = "${local.cards_path}/${each.key}.json"
content = jsonencode({
name = each.key
name = lookup(local.metabase_cards, each.key).name
dataset_query = {
native = {
query = lookup(local.metabase_cards, each.key).native_query
Expand All @@ -98,7 +98,7 @@ resource "local_file" "json_card" {
}
display = "table"
description = lookup(local.metabase_cards, each.key).description
collection_id = tonumber(local.metabase_collection_id)
collection_id = tonumber(restapi_object.collection.id)
visualization_settings = lookup(lookup(local.metabase_cards, each.key), "visualization_settings", {})
embedding_params = {
for variable in lookup(local.metabase_cards, each.key).variables :
Expand All @@ -124,18 +124,18 @@ EOS
}

# Cards mapping on Whistler backend
# resource "restapi_object" "metabase_cards" {
# provider = restapi.backend
# path = "/metabase_cards"
# for_each = module.metabase_analysis.cards_mapping
resource "restapi_object" "metabase_cards_mapping" {
provider = restapi.backend
path = "/metabase_cards"
for_each = restapi_object.cards

# data = jsonencode({
# data = {
# type = "metabase_cards",
# attributes = {
# identifier = each.key,
# card_id = each.value
# }
# }
# })
# }
data = jsonencode({
data = {
type = "metabase_cards",
attributes = {
identifier = each.key,
card_id = each.value.id
}
}
})
}
4 changes: 0 additions & 4 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
# Cards name=>ID mapping output
output "metabase_analysis" {
value = module.metabase_analysis.cards_mapping
}

0 comments on commit c010c0d

Please sign in to comment.