azurermKustoEventhubDataConnection
Manages a Kusto (also known as Azure Data Explorer) EventHub Data Connection
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "my-kusto-rg",
}
);
const azurermEventhubNamespaceEventhubNs =
new azurerm.eventhubNamespace.EventhubNamespace(this, "eventhub_ns", {
location: azurermResourceGroupExample.location,
name: "my-eventhub-ns",
resource_group_name: azurermResourceGroupExample.name,
sku: "Standard",
});
const azurermKustoClusterCluster = new azurerm.kustoCluster.KustoCluster(
this,
"cluster",
{
location: azurermResourceGroupExample.location,
name: "kustocluster",
resource_group_name: azurermResourceGroupExample.name,
sku: [
{
capacity: 2,
name: "Standard_D13_v2",
},
],
}
);
const azurermKustoDatabaseDatabase = new azurerm.kustoDatabase.KustoDatabase(
this,
"database",
{
cluster_name: azurermKustoClusterCluster.name,
hot_cache_period: "P7D",
location: azurermResourceGroupExample.location,
name: "my-kusto-database",
resource_group_name: azurermResourceGroupExample.name,
soft_delete_period: "P31D",
}
);
const azurermEventhubEventhub = new azurerm.eventhub.Eventhub(
this,
"eventhub",
{
message_retention: 1,
name: "my-eventhub",
namespace_name: azurermEventhubNamespaceEventhubNs.name,
partition_count: 1,
resource_group_name: azurermResourceGroupExample.name,
}
);
const azurermEventhubConsumerGroupConsumerGroup =
new azurerm.eventhubConsumerGroup.EventhubConsumerGroup(
this,
"consumer_group",
{
eventhub_name: azurermEventhubEventhub.name,
name: "my-eventhub-consumergroup",
namespace_name: azurermEventhubNamespaceEventhubNs.name,
resource_group_name: azurermResourceGroupExample.name,
}
);
new azurerm.kustoEventhubDataConnection.KustoEventhubDataConnection(
this,
"eventhub_connection",
{
cluster_name: azurermKustoClusterCluster.name,
consumer_group: azurermEventhubConsumerGroupConsumerGroup.name,
data_format: "JSON",
database_name: azurermKustoDatabaseDatabase.name,
eventhub_id: azurermEventhubEventhub.id,
location: azurermResourceGroupExample.location,
mapping_rule_name: "my-table-mapping",
name: "my-kusto-eventhub-data-connection",
resource_group_name: azurermResourceGroupExample.name,
table_name: "my-table",
}
);
Argument Reference
The following arguments are supported:
-
name
- (Required) The name of the Kusto EventHub Data Connection to create. Changing this forces a new resource to be created. -
location
- (Required) The location where the Kusto Database should be created. Changing this forces a new resource to be created. -
resourceGroupName
- (Required) Specifies the Resource Group where the Kusto Database should exist. Changing this forces a new resource to be created. -
clusterName
- (Required) Specifies the name of the Kusto Cluster this data connection will be added to. Changing this forces a new resource to be created. -
compression
- (Optional) Specifies compression type for the connection. Allowed values:gZip
andnone
. Defaults tonone
. Changing this forces a new resource to be created. -
databaseName
- (Required) Specifies the name of the Kusto Database this data connection will be added to. Changing this forces a new resource to be created. -
eventhubId
- (Required) Specifies the resource id of the EventHub this data connection will use for ingestion. Changing this forces a new resource to be created. -
eventSystemProperties
- (Optional) Specifies a list of system properties for the Event Hub. -
consumerGroup
- (Required) Specifies the EventHub consumer group this data connection will use for ingestion. Changing this forces a new resource to be created. -
tableName
- (Optional) Specifies the target table name used for the message ingestion. Table must exist before resource is created. -
identityId
- (Optional) The resource ID of a managed identity (system or user assigned) to be used to authenticate with event hub. -
mappingRuleName
- (Optional) Specifies the mapping rule used for the message ingestion. Mapping rule must exist before resource is created. -
dataFormat
- (Optional) Specifies the data format of the EventHub messages. Allowed values:apacheavro
,avro
,csv
,json
,multijson
,orc
,parquet
,psv
,raw
,scsv
,singlejson
,sohsv
,tsve
,tsv
,txt
, andw3Clogfile
. -
databaseRoutingType
- (Optional) Indication for database routing information from the data connection, by default only database routing information is allowed. Allowed values:single
,multi
. Changing this forces a new resource to be created.
Attributes Reference
The following attributes are exported:
id
- The ID of the Kusto EventHub Data Connection.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 60 minutes) Used when creating the Kusto EventHub Data Connection.update
- (Defaults to 60 minutes) Used when updating the Kusto EventHub Data Connection.read
- (Defaults to 5 minutes) Used when retrieving the Kusto EventHub Data Connection.delete
- (Defaults to 60 minutes) Used when deleting the Kusto EventHub Data Connection.
Import
Kusto EventHub Data Connections can be imported using the resourceId
, e.g.