hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.6k stars 4.64k forks source link

azurerm_mssql_virtual_machine missing items for assessment block #23120

Open SQLCanuck opened 1 year ago

SQLCanuck commented 1 year ago

Is there an existing issue for this?

Community Note

Terraform Version

1.5.4

AzureRM Provider Version

3.7.1

Affected Resource(s)/Data Source(s)

azurerm_mssql_virtual_machine

Terraform Configuration Files

resource "azurerm_mssql_virtual_machine" "sqlvm" {
  virtual_machine_id    = module.host_server.id
  sql_license_type      = local.sql_license
  r_services_enabled    = false
  sql_connectivity_port = 1433
  sql_connectivity_type = "PRIVATE"

  key_vault_credential {
    name                     = "AKV"
    key_vault_url            = data.azurerm_key_vault_secret.KvURI.value
    service_principal_name   = data.azurerm_key_vault_secret.SpID.value
    service_principal_secret = data.azurerm_key_vault_secret.SpSecret.value
  }

  assessment {
    enabled         = true
    run_immediately = false
    schedule {
      monthly_occurrence = 1
      day_of_week        = "Monday"
      start_time         = "00:30"
    }
  }

  sql_instance {
    collation = var.collation
  }

  storage_configuration {
    disk_type             = var.sqldisktype
    storage_workload_type = var.workloadtype
    data_settings {
      default_file_path = "M:\\Data"
      luns              = (var.data_disk_count == "1") ? [1] : range(1, (var.data_disk_count + 1), 1)
    }
    log_settings {
      default_file_path = "L:\\Logs"
      luns              = (var.log_disk_count == "1") ? [30] : range(30, (var.log_disk_count + 30), 1)
    }
    system_db_on_data_disk_enabled = true
    temp_db_settings {
      default_file_path      = "D:\\TempDB"
      luns                   = []
      data_file_count        = 8
      data_file_size_mb      = 7168
      data_file_growth_in_mb = 512
      log_file_size_mb       = 7168
      log_file_growth_mb     = 512
    }
  }
}

Debug Output/Panic Output

N/A

Expected Behaviour

SQL best practices assessment is configured via the provided assessment block.

Actual Behaviour

The "SQL best practices assessment configuration" remains unconfigured. The assessment block is missing a mandatory definition for "Log Analytics workspace name" and the optional "Resource group for AMA resources".

image

Steps to Reproduce

No response

Important Factoids

No response

References

No response

SanderBlom commented 7 months ago

Any updates on this?