Terraform-provider-azurerm: Support for creating Azure Data Explorer tables and ingestion mappings.

Created on 7 Apr 2020  路  2Comments  路  Source: terraform-providers/terraform-provider-azurerm

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Support for creating Azure Data Explorer tables and ingestion mappings. This is required to enable e2e automated deployment of Azure Data Explorer solution that includes creating cluster, creating database, setting database permissions, creating tables, creating ingestion mappings, and creating data connections.

New or Affected Resource(s)

  • azurerm_kusto

References


Related Issue: https://github.com/terraform-providers/terraform-provider-azurerm/issues/5553
Documentation: Create table, Create data mappings

new-resource

Most helpful comment

I've created an initial draft for a resource azurerm_kusto_database_tablewith the following schema to show that it's possible to provide this feature:

resource "azurerm_kusto_database_table" "test" {
  name                = "table1"
  resource_group_name = azurerm_resource_group.test.name
  cluster_name        = azurerm_kusto_cluster.test.name
  database_name       = azurerm_kusto_database.test.name
  doc_string          = "Optional Docstring"
  folder              = "Optional Folder"

  column {
    name = "col1"
    type = "guid"
  }
  column {
    name = "col2"
    type = "dynamic"
  }
}

see https://github.com/terraform-providers/terraform-provider-azurerm/compare/master...jrauschenbusch:r-kusto-database-table for a Diff to the current master state.

I already tested it a bit and it seems like it works as expected.

Some notes:

  • I know that the authentication stuff is a little bit hacky, but i just wanted to get it work without the need to add client authentication attributes to the resource schema.
  • Unfortunately, there is currently no data plan functionality for Kusto within the azure-sdk-for-go dependency. So I had to add and use the azure-kusto-go library. (see https://github.com/Azure/azure-sdk-for-go/issues/7916)
  • I would also like to use prepared statements instead of these "unsafe" Kusto query methods, but it is currently not possible to use them with Mgmt statements. One also have to provide constant query strings when not using the unsafe methods, which is not a feasible approach when implementing a resource with dynamic attribute values.

@tombuildsstuff @mbfrahry Please let me know what you think about it. This would be (together with another resource azurerm_kusto_database_table_ingestion_mapping) the last required piece to get all kinds of Kusto Data Connections deployable via Terraform.

All 2 comments

I've created an initial draft for a resource azurerm_kusto_database_tablewith the following schema to show that it's possible to provide this feature:

resource "azurerm_kusto_database_table" "test" {
  name                = "table1"
  resource_group_name = azurerm_resource_group.test.name
  cluster_name        = azurerm_kusto_cluster.test.name
  database_name       = azurerm_kusto_database.test.name
  doc_string          = "Optional Docstring"
  folder              = "Optional Folder"

  column {
    name = "col1"
    type = "guid"
  }
  column {
    name = "col2"
    type = "dynamic"
  }
}

see https://github.com/terraform-providers/terraform-provider-azurerm/compare/master...jrauschenbusch:r-kusto-database-table for a Diff to the current master state.

I already tested it a bit and it seems like it works as expected.

Some notes:

  • I know that the authentication stuff is a little bit hacky, but i just wanted to get it work without the need to add client authentication attributes to the resource schema.
  • Unfortunately, there is currently no data plan functionality for Kusto within the azure-sdk-for-go dependency. So I had to add and use the azure-kusto-go library. (see https://github.com/Azure/azure-sdk-for-go/issues/7916)
  • I would also like to use prepared statements instead of these "unsafe" Kusto query methods, but it is currently not possible to use them with Mgmt statements. One also have to provide constant query strings when not using the unsafe methods, which is not a feasible approach when implementing a resource with dynamic attribute values.

@tombuildsstuff @mbfrahry Please let me know what you think about it. This would be (together with another resource azurerm_kusto_database_table_ingestion_mapping) the last required piece to get all kinds of Kusto Data Connections deployable via Terraform.

Unfortunately there is no progress here due to the lack of a PR review from Hashicorp.

Maybe the used azure_kusto_go library is a problem, which brings a lot of dependencies. Also the lack of support for Prepared Statements for Management calls could be the reason:

Please vote up the related PR to increase the visibility and importance of this new resource as some related resources (Event Grid and IoT Hub Data connections) will only become available if this one and the mapping table resource are ready to use.

Was this page helpful?
0 / 5 - 0 ratings