Skip to content

Commit

Permalink
Merge pull request #9692 from favoretti/favoretti/kusto_eventhub_data…
Browse files Browse the repository at this point in the history
…_connection_compression

azurerm_kusto_eventhub_data_connection: Support for `compression`
  • Loading branch information
tombuildsstuff authored Dec 7, 2020
2 parents 6d815ce + 9669fdd commit dede82a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -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
}
5 changes: 4 additions & 1 deletion website/docs/r/kusto_eventhub_data_connection.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

Expand Down

0 comments on commit dede82a

Please sign in to comment.