azurestack_managed_disk

Manage a managed disk.

Example Usage with Create Empty

resource "azurestack_resource_group" "test" {
  name     = "acctestRG"
  location = "West US 2"
}

resource "azurestack_managed_disk" "test" {
  name                 = "acctestmd"
  location             = "West US 2"
  resource_group_name  = azurestack_resource_group.test.name
  storage_account_type = "Standard_LRS"
  create_option        = "Empty"
  disk_size_gb         = "1"

  tags = {
    environment = "staging"
  }
}

Example Usage with Create Copy

resource "azurestack_resource_group" "test" {
  name     = "acctestRG"
  location = "West US 2"
}

resource "azurestack_managed_disk" "source" {
  name                 = "acctestmd1"
  location             = "West US 2"
  resource_group_name  = azurestack_resource_group.test.name
  storage_account_type = "Standard_LRS"
  create_option        = "Empty"
  disk_size_gb         = "1"

  tags = {
    environment = "staging"
  }
}

resource "azurestack_managed_disk" "copy" {
  name                 = "acctestmd2"
  location             = "West US 2"
  resource_group_name  = azurestack_resource_group.test.name
  storage_account_type = "Standard_LRS"
  create_option        = "Copy"
  source_resource_id   = azurestack_managed_disk.source.id
  disk_size_gb         = "1"

  tags = {
    environment = "staging"
  }
}

Argument Reference

The following arguments are supported:


The encryption block supports:


For more information on managed disks, such as sizing options and pricing, please check out the azure documentation.

Attributes Reference

The following attributes are exported:

Import

Managed Disks can be imported using the resource id, e.g.

terraform import azurestack_managed_disk.test /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/microsoft.compute/disks/manageddisk1