We are creating log analytics workspace using the following terraform code:
resource “azurerm_log_analytics_workspace” “workspace” {
count = var.workspace_id == null ? 1 : 0
name = var.workspace_name
location = var.location
resource_group_name = var.resource_group_name
sku = var.sku
retention_in_days = var.retention_in_days
}
and we have not used --force delete flag and but we ran a terraform apply command ,due to incorrect region it destroyed the workspace (hard delete: non recoverable) instead of soft delete.
terraform plan command:
terraform plan -out=tfplan
Terraform apply command:
terraform apply -no-color -input=false -auto-approve tfplan