Skip to content

Commit

Permalink
azurerm_kusto_cluster - Support for enable_purge #7375
Browse files Browse the repository at this point in the history
  • Loading branch information
jrauschenbusch authored Jun 18, 2020
1 parent fdfa243 commit 23533b1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions azurerm/internal/services/kusto/kusto_cluster_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ func resourceArmKustoCluster() *schema.Resource {
Optional: true,
},

"enable_purge": {
Type: schema.TypeBool,
Optional: true,
},

"uri": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -142,6 +147,7 @@ func resourceArmKustoClusterCreateUpdate(d *schema.ResourceData, meta interface{
clusterProperties := kusto.ClusterProperties{
EnableDiskEncryption: utils.Bool(d.Get("enable_disk_encryption").(bool)),
EnableStreamingIngest: utils.Bool(d.Get("enable_streaming_ingest").(bool)),
EnablePurge: utils.Bool(d.Get("enable_purge").(bool)),
}

t := d.Get("tags").(map[string]interface{})
Expand Down Expand Up @@ -211,6 +217,7 @@ func resourceArmKustoClusterRead(d *schema.ResourceData, meta interface{}) error
if clusterProperties := clusterResponse.ClusterProperties; clusterProperties != nil {
d.Set("enable_disk_encryption", clusterProperties.EnableDiskEncryption)
d.Set("enable_streaming_ingest", clusterProperties.EnableStreamingIngest)
d.Set("enable_purge", clusterProperties.EnablePurge)
d.Set("uri", clusterProperties.URI)
d.Set("data_ingestion_uri", clusterProperties.DataIngestionURI)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func TestAccAzureRMKustoCluster_update(t *testing.T) {
testCheckAzureRMKustoClusterExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "enable_disk_encryption", "false"),
resource.TestCheckResourceAttr(data.ResourceName, "enable_streaming_ingest", "false"),
resource.TestCheckResourceAttr(data.ResourceName, "enable_purge", "false"),
),
},
data.ImportStep(),
Expand All @@ -53,6 +54,7 @@ func TestAccAzureRMKustoCluster_update(t *testing.T) {
testCheckAzureRMKustoClusterExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "enable_disk_encryption", "true"),
resource.TestCheckResourceAttr(data.ResourceName, "enable_streaming_ingest", "true"),
resource.TestCheckResourceAttr(data.ResourceName, "enable_purge", "true"),
),
},
data.ImportStep(),
Expand All @@ -62,6 +64,7 @@ func TestAccAzureRMKustoCluster_update(t *testing.T) {
testCheckAzureRMKustoClusterExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "enable_disk_encryption", "false"),
resource.TestCheckResourceAttr(data.ResourceName, "enable_streaming_ingest", "false"),
resource.TestCheckResourceAttr(data.ResourceName, "enable_purge", "false"),
),
},
data.ImportStep(),
Expand Down Expand Up @@ -248,6 +251,7 @@ resource "azurerm_kusto_cluster" "test" {
resource_group_name = azurerm_resource_group.test.name
enable_disk_encryption = true
enable_streaming_ingest = true
enable_purge = true
sku {
name = "Dev(No SLA)_Standard_D11_v2"
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/kusto_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ The following arguments are supported:

* `enable_streaming_ingest` - (Optional) Specifies if the streaming ingest is enabled.

* `enable_purge` - (Optional) Specifies if the purge operations are enabled.

* `tags` - (Optional) A mapping of tags to assign to the resource.

---
Expand Down

0 comments on commit 23533b1

Please sign in to comment.