Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_kusto_cluster - Support for enable_purge #7375

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions azurerm/internal/services/kusto/kusto_cluster_resource.go
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
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
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