azurerm_kusto_iothub_data_connection

Manages a Kusto (also known as Azure Data Explorer) IotHub Data Connection

Example Usage

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_kusto_cluster" "example" {
  name                = "examplekustocluster"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name

  sku {
    name     = "Standard_D13_v2"
    capacity = 2
  }
}

resource "azurerm_kusto_database" "example" {
  name                = "example-kusto-database"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
  cluster_name        = azurerm_kusto_cluster.example.name
  hot_cache_period    = "P7D"
  soft_delete_period  = "P31D"
}

resource "azurerm_iothub" "example" {
  name                = "exampleIoTHub"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location

  sku {
    name     = "B1"
    capacity = "1"
  }
}

resource "azurerm_iothub_shared_access_policy" "example" {
  name                = "example-shared-access-policy"
  resource_group_name = azurerm_resource_group.example.name
  iothub_name         = azurerm_iothub.example.name

  registry_read = true
}

resource "azurerm_iothub_consumer_group" "example" {
  name                   = "example-consumer-group"
  resource_group_name    = azurerm_resource_group.example.name
  iothub_name            = azurerm_iothub.example.name
  eventhub_endpoint_name = "events"
}

resource "azurerm_kusto_iothub_data_connection" "example" {
  name                = "my-kusto-iothub-data-connection"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
  cluster_name        = azurerm_kusto_cluster.example.name
  database_name       = azurerm_kusto_database.example.name

  iothub_id                 = azurerm_iothub.example.id
  consumer_group            = azurerm_iothub_consumer_group.example.name
  shared_access_policy_name = azurerm_iothub_shared_access_policy.example.name
  event_system_properties   = ["message-id", "sequence-number", "to"]

  table_name        = "my-table"
  mapping_rule_name = "my-table-mapping"
  data_format       = "JSON"
}

Argument Reference

The following arguments are supported:

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

Kusto IotHub Data Connections can be imported using the resource id, e.g.

terraform import azurerm_kusto_iothub_data_connection.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Kusto/clusters/cluster1/databases/database1/dataConnections/dataConnection1