diff --git a/azurerm/internal/services/kusto/kusto_eventhub_data_connection_resource.go b/azurerm/internal/services/kusto/kusto_eventhub_data_connection_resource.go index 4a2cdeec4ed5..7536a318398f 100644 --- a/azurerm/internal/services/kusto/kusto_eventhub_data_connection_resource.go +++ b/azurerm/internal/services/kusto/kusto_eventhub_data_connection_resource.go @@ -55,6 +55,17 @@ func resourceArmKustoEventHubDataConnection() *schema.Resource { ValidateFunc: validateAzureRMKustoClusterName, }, + "compression": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Default: kusto.CompressionNone, + ValidateFunc: validation.StringInSlice([]string{ + string(kusto.CompressionGZip), + string(kusto.CompressionNone), + }, false), + }, + "database_name": { Type: schema.TypeString, Required: true, @@ -218,6 +229,7 @@ func resourceArmKustoEventHubDataConnectionRead(d *schema.ResourceData, meta int d.Set("table_name", props.TableName) d.Set("mapping_rule_name", props.MappingRuleName) d.Set("data_format", props.DataFormat) + d.Set("compression", props.Compression) } } @@ -305,5 +317,9 @@ func expandKustoEventHubDataConnectionProperties(d *schema.ResourceData) *kusto. eventHubConnectionProperties.DataFormat = kusto.EventHubDataFormat(df.(string)) } + if compression, ok := d.GetOk("compression"); ok { + eventHubConnectionProperties.Compression = kusto.Compression(compression.(string)) + } + return eventHubConnectionProperties } diff --git a/website/docs/r/kusto_eventhub_data_connection.html.markdown b/website/docs/r/kusto_eventhub_data_connection.html.markdown index 71f0747d5426..f5462506615b 100644 --- a/website/docs/r/kusto_eventhub_data_connection.html.markdown +++ b/website/docs/r/kusto_eventhub_data_connection.html.markdown @@ -88,8 +88,12 @@ The following arguments are supported: * `cluster_name` - (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` and `None`. Defaults to `None`. Changing this forces a new resource to be created. + * `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. * `consumer_group` - (Required) Specifies the EventHub consumer group this data connection will use for ingestion. Changing this forces a new resource to be created. @@ -98,7 +102,6 @@ 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