ManagedDiskArgs

data class ManagedDiskArgs(val createOption: Output<String>? = null, val diskAccessId: Output<String>? = null, val diskEncryptionSetId: Output<String>? = null, val diskIopsReadOnly: Output<Int>? = null, val diskIopsReadWrite: Output<Int>? = null, val diskMbpsReadOnly: Output<Int>? = null, val diskMbpsReadWrite: Output<Int>? = null, val diskSizeGb: Output<Int>? = null, val edgeZone: Output<String>? = null, val encryptionSettings: Output<ManagedDiskEncryptionSettingsArgs>? = null, val galleryImageReferenceId: Output<String>? = null, val hyperVGeneration: Output<String>? = null, val imageReferenceId: Output<String>? = null, val location: Output<String>? = null, val logicalSectorSize: Output<Int>? = null, val maxShares: Output<Int>? = null, val name: Output<String>? = null, val networkAccessPolicy: Output<String>? = null, val onDemandBurstingEnabled: Output<Boolean>? = null, val optimizedFrequentAttachEnabled: Output<Boolean>? = null, val osType: Output<String>? = null, val performancePlusEnabled: Output<Boolean>? = null, val publicNetworkAccessEnabled: Output<Boolean>? = null, val resourceGroupName: Output<String>? = null, val secureVmDiskEncryptionSetId: Output<String>? = null, val securityType: Output<String>? = null, val sourceResourceId: Output<String>? = null, val sourceUri: Output<String>? = null, val storageAccountId: Output<String>? = null, val storageAccountType: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val tier: Output<String>? = null, val trustedLaunchEnabled: Output<Boolean>? = null, val uploadSizeBytes: Output<Int>? = null, val zone: Output<String>? = null) : ConvertibleToJava<ManagedDiskArgs>

Manages a managed disk.

Example Usage

With Create Empty

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleManagedDisk = new azure.compute.ManagedDisk("example", {
name: "acctestmd",
location: example.location,
resourceGroupName: example.name,
storageAccountType: "Standard_LRS",
createOption: "Empty",
diskSizeGb: 1,
tags: {
environment: "staging",
},
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_managed_disk = azure.compute.ManagedDisk("example",
name="acctestmd",
location=example.location,
resource_group_name=example.name,
storage_account_type="Standard_LRS",
create_option="Empty",
disk_size_gb=1,
tags={
"environment": "staging",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var exampleManagedDisk = new Azure.Compute.ManagedDisk("example", new()
{
Name = "acctestmd",
Location = example.Location,
ResourceGroupName = example.Name,
StorageAccountType = "Standard_LRS",
CreateOption = "Empty",
DiskSizeGb = 1,
Tags =
{
{ "environment", "staging" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
_, err = compute.NewManagedDisk(ctx, "example", &compute.ManagedDiskArgs{
Name: pulumi.String("acctestmd"),
Location: example.Location,
ResourceGroupName: example.Name,
StorageAccountType: pulumi.String("Standard_LRS"),
CreateOption: pulumi.String("Empty"),
DiskSizeGb: pulumi.Int(1),
Tags: pulumi.StringMap{
"environment": pulumi.String("staging"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.compute.ManagedDisk;
import com.pulumi.azure.compute.ManagedDiskArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var exampleManagedDisk = new ManagedDisk("exampleManagedDisk", ManagedDiskArgs.builder()
.name("acctestmd")
.location(example.location())
.resourceGroupName(example.name())
.storageAccountType("Standard_LRS")
.createOption("Empty")
.diskSizeGb("1")
.tags(Map.of("environment", "staging"))
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleManagedDisk:
type: azure:compute:ManagedDisk
name: example
properties:
name: acctestmd
location: ${example.location}
resourceGroupName: ${example.name}
storageAccountType: Standard_LRS
createOption: Empty
diskSizeGb: '1'
tags:
environment: staging

With Create Copy

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const source = new azure.compute.ManagedDisk("source", {
name: "acctestmd1",
location: example.location,
resourceGroupName: example.name,
storageAccountType: "Standard_LRS",
createOption: "Empty",
diskSizeGb: 1,
tags: {
environment: "staging",
},
});
const copy = new azure.compute.ManagedDisk("copy", {
name: "acctestmd2",
location: example.location,
resourceGroupName: example.name,
storageAccountType: "Standard_LRS",
createOption: "Copy",
sourceResourceId: source.id,
diskSizeGb: 1,
tags: {
environment: "staging",
},
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
source = azure.compute.ManagedDisk("source",
name="acctestmd1",
location=example.location,
resource_group_name=example.name,
storage_account_type="Standard_LRS",
create_option="Empty",
disk_size_gb=1,
tags={
"environment": "staging",
})
copy = azure.compute.ManagedDisk("copy",
name="acctestmd2",
location=example.location,
resource_group_name=example.name,
storage_account_type="Standard_LRS",
create_option="Copy",
source_resource_id=source.id,
disk_size_gb=1,
tags={
"environment": "staging",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var source = new Azure.Compute.ManagedDisk("source", new()
{
Name = "acctestmd1",
Location = example.Location,
ResourceGroupName = example.Name,
StorageAccountType = "Standard_LRS",
CreateOption = "Empty",
DiskSizeGb = 1,
Tags =
{
{ "environment", "staging" },
},
});
var copy = new Azure.Compute.ManagedDisk("copy", new()
{
Name = "acctestmd2",
Location = example.Location,
ResourceGroupName = example.Name,
StorageAccountType = "Standard_LRS",
CreateOption = "Copy",
SourceResourceId = source.Id,
DiskSizeGb = 1,
Tags =
{
{ "environment", "staging" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
source, err := compute.NewManagedDisk(ctx, "source", &compute.ManagedDiskArgs{
Name: pulumi.String("acctestmd1"),
Location: example.Location,
ResourceGroupName: example.Name,
StorageAccountType: pulumi.String("Standard_LRS"),
CreateOption: pulumi.String("Empty"),
DiskSizeGb: pulumi.Int(1),
Tags: pulumi.StringMap{
"environment": pulumi.String("staging"),
},
})
if err != nil {
return err
}
_, err = compute.NewManagedDisk(ctx, "copy", &compute.ManagedDiskArgs{
Name: pulumi.String("acctestmd2"),
Location: example.Location,
ResourceGroupName: example.Name,
StorageAccountType: pulumi.String("Standard_LRS"),
CreateOption: pulumi.String("Copy"),
SourceResourceId: source.ID(),
DiskSizeGb: pulumi.Int(1),
Tags: pulumi.StringMap{
"environment": pulumi.String("staging"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.compute.ManagedDisk;
import com.pulumi.azure.compute.ManagedDiskArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var source = new ManagedDisk("source", ManagedDiskArgs.builder()
.name("acctestmd1")
.location(example.location())
.resourceGroupName(example.name())
.storageAccountType("Standard_LRS")
.createOption("Empty")
.diskSizeGb("1")
.tags(Map.of("environment", "staging"))
.build());
var copy = new ManagedDisk("copy", ManagedDiskArgs.builder()
.name("acctestmd2")
.location(example.location())
.resourceGroupName(example.name())
.storageAccountType("Standard_LRS")
.createOption("Copy")
.sourceResourceId(source.id())
.diskSizeGb("1")
.tags(Map.of("environment", "staging"))
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
source:
type: azure:compute:ManagedDisk
properties:
name: acctestmd1
location: ${example.location}
resourceGroupName: ${example.name}
storageAccountType: Standard_LRS
createOption: Empty
diskSizeGb: '1'
tags:
environment: staging
copy:
type: azure:compute:ManagedDisk
properties:
name: acctestmd2
location: ${example.location}
resourceGroupName: ${example.name}
storageAccountType: Standard_LRS
createOption: Copy
sourceResourceId: ${source.id}
diskSizeGb: '1'
tags:
environment: staging

Import

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

$ pulumi import azure:compute/managedDisk:ManagedDisk example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/disks/manageddisk1

Constructors

Link copied to clipboard
constructor(createOption: Output<String>? = null, diskAccessId: Output<String>? = null, diskEncryptionSetId: Output<String>? = null, diskIopsReadOnly: Output<Int>? = null, diskIopsReadWrite: Output<Int>? = null, diskMbpsReadOnly: Output<Int>? = null, diskMbpsReadWrite: Output<Int>? = null, diskSizeGb: Output<Int>? = null, edgeZone: Output<String>? = null, encryptionSettings: Output<ManagedDiskEncryptionSettingsArgs>? = null, galleryImageReferenceId: Output<String>? = null, hyperVGeneration: Output<String>? = null, imageReferenceId: Output<String>? = null, location: Output<String>? = null, logicalSectorSize: Output<Int>? = null, maxShares: Output<Int>? = null, name: Output<String>? = null, networkAccessPolicy: Output<String>? = null, onDemandBurstingEnabled: Output<Boolean>? = null, optimizedFrequentAttachEnabled: Output<Boolean>? = null, osType: Output<String>? = null, performancePlusEnabled: Output<Boolean>? = null, publicNetworkAccessEnabled: Output<Boolean>? = null, resourceGroupName: Output<String>? = null, secureVmDiskEncryptionSetId: Output<String>? = null, securityType: Output<String>? = null, sourceResourceId: Output<String>? = null, sourceUri: Output<String>? = null, storageAccountId: Output<String>? = null, storageAccountType: Output<String>? = null, tags: Output<Map<String, String>>? = null, tier: Output<String>? = null, trustedLaunchEnabled: Output<Boolean>? = null, uploadSizeBytes: Output<Int>? = null, zone: Output<String>? = null)

Properties

Link copied to clipboard
val createOption: Output<String>? = null

The method to use when creating the managed disk. Changing this forces a new resource to be created. Possible values include:

Link copied to clipboard
val diskAccessId: Output<String>? = null

The ID of the disk access resource for using private endpoints on disks.

Link copied to clipboard
val diskEncryptionSetId: Output<String>? = null

The ID of a Disk Encryption Set which should be used to encrypt this Managed Disk. Conflicts with secure_vm_disk_encryption_set_id.

Link copied to clipboard
val diskIopsReadOnly: Output<Int>? = null

The number of IOPS allowed across all VMs mounting the shared disk as read-only; only settable for UltraSSD disks and PremiumV2 disks with shared disk enabled. One operation can transfer between 4k and 256k bytes.

Link copied to clipboard
val diskIopsReadWrite: Output<Int>? = null

The number of IOPS allowed for this disk; only settable for UltraSSD disks and PremiumV2 disks. One operation can transfer between 4k and 256k bytes.

Link copied to clipboard
val diskMbpsReadOnly: Output<Int>? = null

The bandwidth allowed across all VMs mounting the shared disk as read-only; only settable for UltraSSD disks and PremiumV2 disks with shared disk enabled. MBps means millions of bytes per second.

Link copied to clipboard
val diskMbpsReadWrite: Output<Int>? = null

The bandwidth allowed for this disk; only settable for UltraSSD disks and PremiumV2 disks. MBps means millions of bytes per second.

Link copied to clipboard
val diskSizeGb: Output<Int>? = null
Link copied to clipboard
val edgeZone: Output<String>? = null

Specifies the Edge Zone within the Azure Region where this Managed Disk should exist. Changing this forces a new Managed Disk to be created.

Link copied to clipboard

A encryption_settings block as defined below.

Link copied to clipboard
val galleryImageReferenceId: Output<String>? = null

ID of a Gallery Image Version to copy when create_option is FromImage. This field cannot be specified if image_reference_id is specified. Changing this forces a new resource to be created.

Link copied to clipboard
val hyperVGeneration: Output<String>? = null

The HyperV Generation of the Disk when the source of an Import or Copy operation targets a source that contains an operating system. Possible values are V1 and V2. For ImportSecure it must be set to V2. Changing this forces a new resource to be created.

Link copied to clipboard
val imageReferenceId: Output<String>? = null

ID of an existing platform/marketplace disk image to copy when create_option is FromImage. This field cannot be specified if gallery_image_reference_id is specified. Changing this forces a new resource to be created.

Link copied to clipboard
val location: Output<String>? = null

Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.

Link copied to clipboard
val logicalSectorSize: Output<Int>? = null

Logical Sector Size. Possible values are: 512 and 4096. Defaults to 4096. Changing this forces a new resource to be created.

Link copied to clipboard
val maxShares: Output<Int>? = null

The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time.

Link copied to clipboard
val name: Output<String>? = null

Specifies the name of the Managed Disk. Changing this forces a new resource to be created.

Link copied to clipboard
val networkAccessPolicy: Output<String>? = null

Policy for accessing the disk via network. Allowed values are AllowAll, AllowPrivate, and DenyAll.

Link copied to clipboard
val onDemandBurstingEnabled: Output<Boolean>? = null

Specifies if On-Demand Bursting is enabled for the Managed Disk.

Link copied to clipboard

Specifies whether this Managed Disk should be optimized for frequent disk attachments (where a disk is attached/detached more than 5 times in a day). Defaults to false.

Link copied to clipboard
val osType: Output<String>? = null

Specify a value when the source of an Import, ImportSecure or Copy operation targets a source that contains an operating system. Valid values are Linux or Windows.

Link copied to clipboard
val performancePlusEnabled: Output<Boolean>? = null

Specifies whether Performance Plus is enabled for this Managed Disk. Defaults to false. Changing this forces a new resource to be created.

Link copied to clipboard
val publicNetworkAccessEnabled: Output<Boolean>? = null

Whether it is allowed to access the disk via public network. Defaults to true. For more information on managed disks, such as sizing options and pricing, please check out the Azure Documentation.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the Resource Group where the Managed Disk should exist. Changing this forces a new resource to be created.

Link copied to clipboard
val secureVmDiskEncryptionSetId: Output<String>? = null

The ID of the Disk Encryption Set which should be used to Encrypt this OS Disk when the Virtual Machine is a Confidential VM. Conflicts with disk_encryption_set_id. Changing this forces a new resource to be created.

Link copied to clipboard
val securityType: Output<String>? = null

Security Type of the Managed Disk when it is used for a Confidential VM. Possible values are ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey, ConfidentialVM_DiskEncryptedWithPlatformKey and ConfidentialVM_DiskEncryptedWithCustomerKey. Changing this forces a new resource to be created.

Link copied to clipboard
val sourceResourceId: Output<String>? = null

The ID of an existing Managed Disk or Snapshot to copy when create_option is Copy or the recovery point to restore when create_option is Restore. Changing this forces a new resource to be created.

Link copied to clipboard
val sourceUri: Output<String>? = null

URI to a valid VHD file to be used when create_option is Import or ImportSecure. Changing this forces a new resource to be created.

Link copied to clipboard
val storageAccountId: Output<String>? = null

The ID of the Storage Account where the source_uri is located. Required when create_option is set to Import or ImportSecure. Changing this forces a new resource to be created.

Link copied to clipboard
val storageAccountType: Output<String>? = null

The type of storage to use for the managed disk. Possible values are Standard_LRS, StandardSSD_ZRS, Premium_LRS, PremiumV2_LRS, Premium_ZRS, StandardSSD_LRS or UltraSSD_LRS.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A mapping of tags to assign to the resource.

Link copied to clipboard
val tier: Output<String>? = null
Link copied to clipboard
val trustedLaunchEnabled: Output<Boolean>? = null

Specifies if Trusted Launch is enabled for the Managed Disk. Changing this forces a new resource to be created.

Link copied to clipboard
val uploadSizeBytes: Output<Int>? = null

Specifies the size of the managed disk to create in bytes. Required when create_option is Upload. The value must be equal to the source disk to be copied in bytes. Source disk size could be calculated with ls -l or wc -c. More information can be found at Copy a managed disk. Changing this forces a new resource to be created.

Link copied to clipboard
val zone: Output<String>? = null

Specifies the Availability Zone in which this Managed Disk should be located. Changing this property forces a new resource to be created.

Functions

Link copied to clipboard
open override fun toJava(): ManagedDiskArgs