The Features Block

The Azure Stack Provider allows the behaviour of certain resources to be configured using the features block.

This allows different users to select the behaviour they require, for example some users may wish for the OS Disks for a Virtual Machine to be removed automatically when the Virtual Machine is destroyed - whereas other users may wish for these OS Disks to be detached but not deleted.

Example Usage

If you wish to use the default behaviours of the Azure Stack Provider, then you only need to define an empty features block as below:

provider "azurestack" {
  features {}
}

Each of the blocks defined below can be optionally specified to configure the behaviour as needed - this example shows all the possible behaviours which can be configured:

provider "azurestack" {
  features {
    resource_group {
      prevent_deletion_if_contains_resources = true
    }

    virtual_machine {
      delete_os_disk_on_deletion     = true
      graceful_shutdown              = false
      skip_shutdown_and_force_delete = false
    }

    virtual_machine_scale_set {
      force_delete                  = false
      roll_instances_when_required  = true
      scale_to_zero_before_deletion = true
    }
  }
}

Arguments Reference

The features block supports the following:


The resource_group block supports the following:


The virtual_machine block supports the following:


The virtual_machine_scale_set block supports the following: