azurerm_mssql_virtual_machine

Manages a Microsoft SQL Virtual Machine

Example Usage

This example provisions a brief Managed Microsoft SQL Virtual Machine. The detailed example of the azurerm_mssql_virtual_machine resource can be found in the ./examples/mssql/mssqlvm directory within the GitHub Repository

data "azurerm_virtual_machine" "example" {
  name                = "example-vm"
  resource_group_name = "example-resources"
}

resource "azurerm_mssql_virtual_machine" "example" {
  virtual_machine_id               = data.azurerm_virtual_machine.example.id
  sql_license_type                 = "PAYG"
  r_services_enabled               = true
  sql_connectivity_port            = 1433
  sql_connectivity_type            = "PRIVATE"
  sql_connectivity_update_password = "Password1234!"
  sql_connectivity_update_username = "sqllogin"

  auto_patching {
    day_of_week                            = "Sunday"
    maintenance_window_duration_in_minutes = 60
    maintenance_window_starting_hour       = 2
  }
}

Argument Reference

The following arguments are supported:


The auto_backup block supports the following:


The manual_schedule block supports the following:


The auto_patching block supports the following:


The key_vault_credential block supports the following:


The sql_instance block supports the following:


The storage_configuration block supports the following:


The storage_settings block supports the following:


The temp_db_settings block supports the following:


The assessment block supports the following:


The schedule block supports the following:


The wsfc_domain_credential block supports the following:

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

Microsoft SQL Virtual Machines can be imported using the resource id, e.g.

terraform import azurerm_mssql_virtual_machine.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/example1