From 8f3116f5c1c84709344001ad5c4c155158cd0941 Mon Sep 17 00:00:00 2001 From: Eliise Date: Mon, 21 Jun 2021 13:56:49 +0200 Subject: [PATCH 1/9] Add missing properties --- .../kusto_iothub_data_connection_resource.go | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go b/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go index 0ae00520e86b..bdcbe50ba387 100644 --- a/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go +++ b/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go @@ -76,6 +76,41 @@ func resourceKustoIotHubDataConnection() *pluginsdk.Resource { ValidateFunc: iothubValidate.IoTHubConsumerGroupName, }, + "table_name": { + Type: pluginsdk.TypeString, + Optional: true, + ValidateFunc: validate.EntityName, + }, + + "mapping_rule_name": { + Type: pluginsdk.TypeString, + Optional: true, + ValidateFunc: validate.EntityName, + }, + + "data_format": { + Type: pluginsdk.TypeString, + Optional: true, + ValidateFunc: validation.StringInSlice([]string{ + string(kusto.EventHubDataFormatAPACHEAVRO), + string(kusto.EventHubDataFormatAVRO), + string(kusto.EventHubDataFormatCSV), + string(kusto.EventHubDataFormatJSON), + string(kusto.EventHubDataFormatMULTIJSON), + string(kusto.EventHubDataFormatORC), + string(kusto.EventHubDataFormatPARQUET), + string(kusto.EventHubDataFormatPSV), + string(kusto.EventHubDataFormatRAW), + string(kusto.EventHubDataFormatSCSV), + string(kusto.EventHubDataFormatSINGLEJSON), + string(kusto.EventHubDataFormatSOHSV), + string(kusto.EventHubDataFormatTSV), + string(kusto.EventHubDataFormatTSVE), + string(kusto.EventHubDataFormatTXT), + string(kusto.EventHubDataFormatW3CLOGFILE), + }, false), + }, + "shared_access_policy_name": { Type: pluginsdk.TypeString, Required: true, @@ -133,6 +168,9 @@ func resourceKustoIotHubDataConnectionCreate(d *pluginsdk.ResourceData, meta int IotHubConnectionProperties: &kusto.IotHubConnectionProperties{ IotHubResourceID: utils.String(d.Get("iothub_id").(string)), ConsumerGroup: utils.String(d.Get("consumer_group").(string)), + TableName : utils.String(d.Get("table_name").(string)), + MappingRuleName : utils.String(d.Get("mapping_rule_name").(string)), + DataFormat : kusto.IotHubDataFormat(d.Get("data_format").(string)), SharedAccessPolicyName: utils.String(d.Get("shared_access_policy_name").(string)), }, } @@ -183,6 +221,9 @@ func resourceKustoIotHubDataConnectionRead(d *pluginsdk.ResourceData, meta inter if props := dataConnection.IotHubConnectionProperties; props != nil { d.Set("iothub_id", props.IotHubResourceID) d.Set("consumer_group", props.ConsumerGroup) + d.Set("table_name", props.TableName) + d.Set("mapping_rule_name", props.MappingRuleName) + d.Set("data_format", props.DataFormat) d.Set("shared_access_policy_name", props.SharedAccessPolicyName) d.Set("event_system_properties", utils.FlattenStringSlice(props.EventSystemProperties)) } From 1a68e68857bb93b242cec7b6590ac197389af5de Mon Sep 17 00:00:00 2001 From: Eliise Date: Mon, 21 Jun 2021 14:58:54 +0200 Subject: [PATCH 2/9] Use correct format --- .../kusto_iothub_data_connection_resource.go | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go b/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go index bdcbe50ba387..8a8e2e6aadcf 100644 --- a/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go +++ b/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go @@ -92,22 +92,22 @@ func resourceKustoIotHubDataConnection() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ValidateFunc: validation.StringInSlice([]string{ - string(kusto.EventHubDataFormatAPACHEAVRO), - string(kusto.EventHubDataFormatAVRO), - string(kusto.EventHubDataFormatCSV), - string(kusto.EventHubDataFormatJSON), - string(kusto.EventHubDataFormatMULTIJSON), - string(kusto.EventHubDataFormatORC), - string(kusto.EventHubDataFormatPARQUET), - string(kusto.EventHubDataFormatPSV), - string(kusto.EventHubDataFormatRAW), - string(kusto.EventHubDataFormatSCSV), - string(kusto.EventHubDataFormatSINGLEJSON), - string(kusto.EventHubDataFormatSOHSV), - string(kusto.EventHubDataFormatTSV), - string(kusto.EventHubDataFormatTSVE), - string(kusto.EventHubDataFormatTXT), - string(kusto.EventHubDataFormatW3CLOGFILE), + string(kusto.IotHubDataFormatAPACHEAVRO), + string(kusto.IotHubDataFormatAVRO), + string(kusto.IotHubDataFormatCSV), + string(kusto.IotHubDataFormatJSON), + string(kusto.IotHubDataFormatMULTIJSON), + string(kusto.IotHubDataFormatORC), + string(kusto.IotHubDataFormatPARQUET), + string(kusto.IotHubDataFormatPSV), + string(kusto.IotHubDataFormatRAW), + string(kusto.IotHubDataFormatSCSV), + string(kusto.IotHubDataFormatSINGLEJSON), + string(kusto.IotHubDataFormatSOHSV), + string(kusto.IotHubDataFormatTSV), + string(kusto.IotHubDataFormatTSVE), + string(kusto.IotHubDataFormatTXT), + string(kusto.IotHubDataFormatW3CLOGFILE), }, false), }, From 73e6ce67171b5f0bc30145b01f5ef369ce526c5e Mon Sep 17 00:00:00 2001 From: Eliise Date: Mon, 21 Jun 2021 15:07:41 +0000 Subject: [PATCH 3/9] Format file --- .../services/kusto/kusto_iothub_data_connection_resource.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go b/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go index 8a8e2e6aadcf..8d757cbe674c 100644 --- a/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go +++ b/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go @@ -168,9 +168,9 @@ func resourceKustoIotHubDataConnectionCreate(d *pluginsdk.ResourceData, meta int IotHubConnectionProperties: &kusto.IotHubConnectionProperties{ IotHubResourceID: utils.String(d.Get("iothub_id").(string)), ConsumerGroup: utils.String(d.Get("consumer_group").(string)), - TableName : utils.String(d.Get("table_name").(string)), - MappingRuleName : utils.String(d.Get("mapping_rule_name").(string)), - DataFormat : kusto.IotHubDataFormat(d.Get("data_format").(string)), + TableName: utils.String(d.Get("table_name").(string)), + MappingRuleName: utils.String(d.Get("mapping_rule_name").(string)), + DataFormat: kusto.IotHubDataFormat(d.Get("data_format").(string)), SharedAccessPolicyName: utils.String(d.Get("shared_access_policy_name").(string)), }, } From bdef1e10ad05a453bd6439e5b326526aeaf7e15f Mon Sep 17 00:00:00 2001 From: Eliise Date: Mon, 21 Jun 2021 15:29:15 +0000 Subject: [PATCH 4/9] Fix tests --- .../services/kusto/kusto_iothub_data_connection_resource.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go b/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go index 8d757cbe674c..bf94bddf22cd 100644 --- a/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go +++ b/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go @@ -78,18 +78,21 @@ func resourceKustoIotHubDataConnection() *pluginsdk.Resource { "table_name": { Type: pluginsdk.TypeString, + ForceNew: true, Optional: true, ValidateFunc: validate.EntityName, }, "mapping_rule_name": { Type: pluginsdk.TypeString, + ForceNew: true, Optional: true, ValidateFunc: validate.EntityName, }, "data_format": { Type: pluginsdk.TypeString, + ForceNew: true, Optional: true, ValidateFunc: validation.StringInSlice([]string{ string(kusto.IotHubDataFormatAPACHEAVRO), From 45085cda15e08ca3a0373f4c8d4266f7b34b20c7 Mon Sep 17 00:00:00 2001 From: Eliise Date: Tue, 22 Jun 2021 15:32:09 +0000 Subject: [PATCH 5/9] Don't fill optional properties --- .../kusto_iothub_data_connection_resource.go | 57 ++++++++++++------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go b/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go index bf94bddf22cd..1270da582bdd 100644 --- a/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go +++ b/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource.go @@ -76,6 +76,13 @@ func resourceKustoIotHubDataConnection() *pluginsdk.Resource { ValidateFunc: iothubValidate.IoTHubConsumerGroupName, }, + "shared_access_policy_name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: iothubValidate.IotHubSharedAccessPolicyName, + }, + "table_name": { Type: pluginsdk.TypeString, ForceNew: true, @@ -114,13 +121,6 @@ func resourceKustoIotHubDataConnection() *pluginsdk.Resource { }, false), }, - "shared_access_policy_name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: iothubValidate.IotHubSharedAccessPolicyName, - }, - "event_system_properties": { Type: pluginsdk.TypeSet, Optional: true, @@ -166,20 +166,11 @@ func resourceKustoIotHubDataConnectionCreate(d *pluginsdk.ResourceData, meta int return tf.ImportAsExistsError("azurerm_kusto_iothub_data_connection", id.ID()) } - dataConnection := kusto.IotHubDataConnection{ - Location: utils.String(azure.NormalizeLocation(d.Get("location").(string))), - IotHubConnectionProperties: &kusto.IotHubConnectionProperties{ - IotHubResourceID: utils.String(d.Get("iothub_id").(string)), - ConsumerGroup: utils.String(d.Get("consumer_group").(string)), - TableName: utils.String(d.Get("table_name").(string)), - MappingRuleName: utils.String(d.Get("mapping_rule_name").(string)), - DataFormat: kusto.IotHubDataFormat(d.Get("data_format").(string)), - SharedAccessPolicyName: utils.String(d.Get("shared_access_policy_name").(string)), - }, - } + iotHubDataConnectionProperties := expandKustoIotHubDataConnectionProperties(d) - if eventSystemProperties, ok := d.GetOk("event_system_properties"); ok { - dataConnection.IotHubConnectionProperties.EventSystemProperties = utils.ExpandStringSlice(eventSystemProperties.(*pluginsdk.Set).List()) + dataConnection := kusto.IotHubDataConnection{ + Location: utils.String(azure.NormalizeLocation(d.Get("location").(string))), + IotHubConnectionProperties: iotHubDataConnectionProperties, } future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.ClusterName, id.DatabaseName, id.Name, dataConnection) @@ -256,3 +247,29 @@ func resourceKustoIotHubDataConnectionDelete(d *pluginsdk.ResourceData, meta int return nil } + +func expandKustoIotHubDataConnectionProperties(d *pluginsdk.ResourceData) *kusto.IotHubConnectionProperties { + iotHubDataConnectionProperties := &kusto.IotHubConnectionProperties{ + IotHubResourceID: utils.String(d.Get("iothub_id").(string)), + ConsumerGroup: utils.String(d.Get("consumer_group").(string)), + SharedAccessPolicyName: utils.String(d.Get("shared_access_policy_name").(string)), + } + + if tableName, ok := d.GetOk("table_name"); ok { + iotHubDataConnectionProperties.TableName = utils.String(tableName.(string)) + } + + if mappingRuleName, ok := d.GetOk("mapping_rule_name"); ok { + iotHubDataConnectionProperties.MappingRuleName = utils.String(mappingRuleName.(string)) + } + + if df, ok := d.GetOk("data_format"); ok { + iotHubDataConnectionProperties.DataFormat = kusto.IotHubDataFormat(df.(string)) + } + + if eventSystemProperties, ok := d.GetOk("event_system_properties"); ok { + iotHubDataConnectionProperties.EventSystemProperties = utils.ExpandStringSlice(eventSystemProperties.(*pluginsdk.Set).List()) + } + + return iotHubDataConnectionProperties +} From 898c6a0d216bb655e7bdb106785ab92e2193529f Mon Sep 17 00:00:00 2001 From: Eliise Date: Tue, 22 Jun 2021 15:32:27 +0000 Subject: [PATCH 6/9] Add complete test --- ...to_iothub_data_connection_resource_test.go | 109 ++++++++++++------ 1 file changed, 75 insertions(+), 34 deletions(-) diff --git a/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource_test.go b/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource_test.go index e827d799475c..40b35beaeb90 100644 --- a/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource_test.go +++ b/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource_test.go @@ -31,7 +31,80 @@ func TestAccKustoIotHubDataConnection_basic(t *testing.T) { }) } -func (KustoIotHubDataConnectionResource) basic(data acceptance.TestData) string { +func TestAccKustoIotHubDataConnection_complete(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_kusto_iothub_data_connection", "test") + r := KustoIotHubDataConnectionResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.complete(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func (KustoIotHubDataConnectionResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { + id, err := parse.DataConnectionID(state.ID) + if err != nil { + return nil, err + } + + resp, err := clients.Kusto.DataConnectionsClient.Get(ctx, id.ResourceGroup, id.ClusterName, id.DatabaseName, id.Name) + if err != nil { + return nil, fmt.Errorf("retrieving %s: %v", id.String(), err) + } + + value, ok := resp.Value.AsIotHubDataConnection() + if !ok { + return nil, fmt.Errorf("%s is not an IotHub Data Connection", id.String()) + } + + return utils.Bool(value.IotHubConnectionProperties != nil), nil +} + +func (r KustoIotHubDataConnectionResource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_kusto_iothub_data_connection" "test" { + name = "acctestkedc-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + cluster_name = azurerm_kusto_cluster.test.name + database_name = azurerm_kusto_database.test.name + + iothub_id = azurerm_iothub.test.id + consumer_group = azurerm_iothub_consumer_group.test.name + shared_access_policy_name = azurerm_iothub_shared_access_policy.test.name +} +`, r.template(data), data.RandomInteger) +} + +func (r KustoIotHubDataConnectionResource) complete(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_kusto_iothub_data_connection" "test" { + name = "acctestkedc-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + cluster_name = azurerm_kusto_cluster.test.name + database_name = azurerm_kusto_database.test.name + + iothub_id = azurerm_iothub.test.id + consumer_group = azurerm_iothub_consumer_group.test.name + shared_access_policy_name = azurerm_iothub_shared_access_policy.test.name + event_system_properties = ["message-id", "sequence-number", "to"] + mapping_rule_name = "Json_Mapping" + data_format = "MULTIJSON" +} +`, r.template(data), data.RandomInteger) +} + +func (KustoIotHubDataConnectionResource) template(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { features {} @@ -89,37 +162,5 @@ resource "azurerm_iothub_consumer_group" "test" { eventhub_endpoint_name = "events" resource_group_name = azurerm_resource_group.test.name } - -resource "azurerm_kusto_iothub_data_connection" "test" { - name = "acctestkedc-%d" - resource_group_name = azurerm_resource_group.test.name - location = azurerm_resource_group.test.location - cluster_name = azurerm_kusto_cluster.test.name - database_name = azurerm_kusto_database.test.name - - iothub_id = azurerm_iothub.test.id - consumer_group = azurerm_iothub_consumer_group.test.name - shared_access_policy_name = azurerm_iothub_shared_access_policy.test.name - event_system_properties = ["message-id", "sequence-number", "to"] -} -`, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomInteger, data.RandomInteger, data.RandomInteger) -} - -func (KustoIotHubDataConnectionResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := parse.DataConnectionID(state.ID) - if err != nil { - return nil, err - } - - resp, err := clients.Kusto.DataConnectionsClient.Get(ctx, id.ResourceGroup, id.ClusterName, id.DatabaseName, id.Name) - if err != nil { - return nil, fmt.Errorf("retrieving %s: %v", id.String(), err) - } - - value, ok := resp.Value.AsIotHubDataConnection() - if !ok { - return nil, fmt.Errorf("%s is not an IotHub Data Connection", id.String()) - } - - return utils.Bool(value.IotHubConnectionProperties != nil), nil +`, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomInteger, data.RandomInteger) } From e7f196f1cf2ae92bba4a0568cdd388a7c1542df0 Mon Sep 17 00:00:00 2001 From: Eliise Date: Tue, 22 Jun 2021 16:36:17 +0000 Subject: [PATCH 7/9] Add missing docs --- .../r/kusto_eventhub_data_connection.html.markdown | 2 +- .../docs/r/kusto_iothub_data_connection.html.markdown | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/website/docs/r/kusto_eventhub_data_connection.html.markdown b/website/docs/r/kusto_eventhub_data_connection.html.markdown index ebe9f2f9e5c7..c946420419df 100644 --- a/website/docs/r/kusto_eventhub_data_connection.html.markdown +++ b/website/docs/r/kusto_eventhub_data_connection.html.markdown @@ -92,7 +92,6 @@ The following arguments are supported: * `database_name` - (Required) Specifies the name of the Kusto Database this data connection will be added to. Changing this forces a new resource to be created. -* `data_format` - (Optional) Specifies the data format of the EventHub messages. Allowed values: `AVRO`, `CSV`, `JSON`, `MULTIJSON`, `PSV`, `RAW`, `SCSV`, `SINGLEJSON`, `SOHSV`, `TSV` and `TXT` * `eventhub_id` - (Required) Specifies the resource id of the EventHub this data connection will use for ingestion. Changing this forces a new resource to be created. @@ -104,6 +103,7 @@ The following arguments are supported: * `mapping_rule_name` - (Optional) Specifies the mapping rule used for the message ingestion. Mapping rule must exist before resource is created. +* `data_format` - (Optional) Specifies the data format of the EventHub messages. Allowed values: `AVRO`, `CSV`, `JSON`, `MULTIJSON`, `PSV`, `RAW`, `SCSV`, `SINGLEJSON`, `SOHSV`, `TSV` and `TXT` ## Attributes Reference diff --git a/website/docs/r/kusto_iothub_data_connection.html.markdown b/website/docs/r/kusto_iothub_data_connection.html.markdown index 7cd78a73d447..8f4286d4a021 100644 --- a/website/docs/r/kusto_iothub_data_connection.html.markdown +++ b/website/docs/r/kusto_iothub_data_connection.html.markdown @@ -75,6 +75,10 @@ resource "azurerm_kusto_iothub_data_connection" "example" { 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" } ``` @@ -100,6 +104,12 @@ The following arguments are supported: * `event_system_properties` - (Optional) Specifies the System Properties that each IoT Hub message should contain. Changing this forces a new resource to be created. +* `table_name` - (Optional) Specifies the target table name used for the message ingestion. Table must exist before resource is created. + +* `mapping_rule_name` - (Optional) Specifies the mapping rule used for the message ingestion. Mapping rule must exist before resource is created. + +* `data_format` - (Optional) Specifies the data format of the IoTHub messages. Allowed values: `APACHEAVRO`, `AVRO`, `CSV`, `JSON`, `MULTIJSON`, `ORC`, `PARQUET`, `PSV`, `RAW`, `SCSV`, `SINGLEJSON`, `SOHSV`, `TSV`, `TSVE`, `TXT` and `W3CLOGFILE`. + ## Attributes Reference The following attributes are exported: From 5a894b4b8be44d561807b2c4f9855a757b1221a2 Mon Sep 17 00:00:00 2001 From: Eliise Date: Tue, 22 Jun 2021 16:36:33 +0000 Subject: [PATCH 8/9] Format terraform --- .../kusto/kusto_iothub_data_connection_resource_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource_test.go b/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource_test.go index 40b35beaeb90..cc59af8c01fd 100644 --- a/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource_test.go +++ b/azurerm/internal/services/kusto/kusto_iothub_data_connection_resource_test.go @@ -98,8 +98,8 @@ resource "azurerm_kusto_iothub_data_connection" "test" { consumer_group = azurerm_iothub_consumer_group.test.name shared_access_policy_name = azurerm_iothub_shared_access_policy.test.name event_system_properties = ["message-id", "sequence-number", "to"] - mapping_rule_name = "Json_Mapping" - data_format = "MULTIJSON" + mapping_rule_name = "Json_Mapping" + data_format = "MULTIJSON" } `, r.template(data), data.RandomInteger) } From 50711d20a59d6fc465b27b90d8b37f2f1ccb05a4 Mon Sep 17 00:00:00 2001 From: Eliise Date: Tue, 22 Jun 2021 19:47:04 +0000 Subject: [PATCH 9/9] Fix whitespace --- website/docs/r/kusto_iothub_data_connection.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/kusto_iothub_data_connection.html.markdown b/website/docs/r/kusto_iothub_data_connection.html.markdown index 8f4286d4a021..1d1297f5815f 100644 --- a/website/docs/r/kusto_iothub_data_connection.html.markdown +++ b/website/docs/r/kusto_iothub_data_connection.html.markdown @@ -76,7 +76,7 @@ resource "azurerm_kusto_iothub_data_connection" "example" { shared_access_policy_name = azurerm_iothub_shared_access_policy.example.name event_system_properties = ["message-id", "sequence-number", "to"] - table_name = "my-table" + table_name = "my-table" mapping_rule_name = "my-table-mapping" data_format = "JSON" }