gpt4 book ai didi

azure - Terraform azurerm azurerm_data_factory_dataset_binary 参数定义

转载 作者:行者123 更新时间:2023-12-03 02:22:04 24 4
gpt4 key购买 nike

因此,我一直在尝试在 terraform 中为 azure datafactory 定义数据集,但在规划 terraform 时定义动态参数时,我不断遇到问题。

Terraform 计划输出:

│ Error: Incorrect attribute value type

│ on xxxxxx-xxxxxxx.tf line 69, in resource "azurerm_data_factory_dataset_binary" "xxxxxxx_dataset_source":
│ 69: parameters = <<PARAMETERS
│ 70: {
│ 71: "fileSystem": {
│ 72: "type": "string"
│ 73: },
│ 74: "directory":{
│ 75: "type": "string"
│ 76: }
│ 77: }
│ 78: PARAMETERS

│ Inappropriate value for attribute "parameters": map of string required.

数据集的定义:


resource "azurerm_data_factory_dataset_binary" "xxxxxxx_dataset_source" {
name = join("", [var.config.name, "_storageacount_dataset_source"])
resource_group_name = var.common.resource_group_name
linked_service_name = azurerm_data_factory_linked_service_data_lake_storage_gen2.xxxxxx_storageacount_linkedservice_source.name
data_factory_name = var.config.datafactory_name

parameters = <<PARAMETERS
{
"fileSystem": {
"type": "string"
},
"directory":{
"type": "string"
}
}
PARAMETERS

azure_blob_storage_location {
container = "@dataset().fileSystem"
path = "@dataset().directory"
filename = "/"
}
}

文档不清楚如何定义它。我看到其他人谈论parameters_values,但当尝试使用它时,它说这里不期望它。

提前致谢!

最佳答案

正确的做法是这样的:

resource "azurerm_data_factory_dataset_binary" "xxxxxxx_dataset_source" {
name = join("", [var.config.name, "_storageacount_dataset_source"])
resource_group_name = var.common.resource_group_name
linked_service_name = azurerm_data_factory_linked_service_data_lake_storage_gen2.xxxxxx_storageacount_linkedservice_source.name
data_factory_name = var.config.datafactory_name

parameters = <<PARAMETERS
{
"fileSystem": "",
"directory": ""
}
PARAMETERS

azure_blob_storage_location {
container = "@dataset().fileSystem"
path = "@dataset().directory"
filename = "/"
}
}

关于azure - Terraform azurerm azurerm_data_factory_dataset_binary 参数定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68455035/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com