Show / Hide Table of Contents

Class ManagedDisk

Manages a managed disk.

Example Usage with Create Empty

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
public MyStack()
{
    var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
    {
        Location = "West US 2",
    });
    var exampleManagedDisk = new Azure.Compute.ManagedDisk("exampleManagedDisk", new Azure.Compute.ManagedDiskArgs
    {
        Location = "West US 2",
        ResourceGroupName = exampleResourceGroup.Name,
        StorageAccountType = "Standard_LRS",
        CreateOption = "Empty",
        DiskSizeGb = "1",
        Tags = 
        {
            { "environment", "staging" },
        },
    });
}

}

Example Usage with Create Copy

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
public MyStack()
{
    var example = new Azure.Core.ResourceGroup("example", new Azure.Core.ResourceGroupArgs
    {
        Location = "West US 2",
    });
    var source = new Azure.Compute.ManagedDisk("source", new Azure.Compute.ManagedDiskArgs
    {
        Location = "West US 2",
        ResourceGroupName = example.Name,
        StorageAccountType = "Standard_LRS",
        CreateOption = "Empty",
        DiskSizeGb = "1",
        Tags = 
        {
            { "environment", "staging" },
        },
    });
    var copy = new Azure.Compute.ManagedDisk("copy", new Azure.Compute.ManagedDiskArgs
    {
        Location = "West US 2",
        ResourceGroupName = example.Name,
        StorageAccountType = "Standard_LRS",
        CreateOption = "Copy",
        SourceResourceId = source.Id,
        DiskSizeGb = "1",
        Tags = 
        {
            { "environment", "staging" },
        },
    });
}

}
Inheritance
System.Object
Resource
CustomResource
ManagedDisk
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Azure.Compute
Assembly: Pulumi.Azure.dll
Syntax
public class ManagedDisk : CustomResource

Constructors

View Source

ManagedDisk(String, ManagedDiskArgs, CustomResourceOptions)

Create a ManagedDisk resource with the given unique name, arguments, and options.

Declaration
public ManagedDisk(string name, ManagedDiskArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

ManagedDiskArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

CreateOption

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

Declaration
public Output<string> CreateOption { get; }
Property Value
Type Description
Output<System.String>
View Source

DiskEncryptionSetId

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

Declaration
public Output<string> DiskEncryptionSetId { get; }
Property Value
Type Description
Output<System.String>
View Source

DiskIopsReadWrite

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

Declaration
public Output<int> DiskIopsReadWrite { get; }
Property Value
Type Description
Output<System.Int32>
View Source

DiskMbpsReadWrite

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

Declaration
public Output<int> DiskMbpsReadWrite { get; }
Property Value
Type Description
Output<System.Int32>
View Source

DiskSizeGb

Specifies the size of the managed disk to create in gigabytes. If create_option is Copy or FromImage, then the value must be equal to or greater than the source's size. The size can only be increased.

Declaration
public Output<int> DiskSizeGb { get; }
Property Value
Type Description
Output<System.Int32>
View Source

EncryptionSettings

A encryption_settings block as defined below.

Declaration
public Output<ManagedDiskEncryptionSettings> EncryptionSettings { get; }
Property Value
Type Description
Output<ManagedDiskEncryptionSettings>
View Source

ImageReferenceId

ID of an existing platform/marketplace disk image to copy when create_option is FromImage.

Declaration
public Output<string> ImageReferenceId { get; }
Property Value
Type Description
Output<System.String>
View Source

Location

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

Declaration
public Output<string> Location { get; }
Property Value
Type Description
Output<System.String>
View Source

Name

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

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

OsType

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

Declaration
public Output<string> OsType { get; }
Property Value
Type Description
Output<System.String>
View Source

ResourceGroupName

The name of the Resource Group where the Managed Disk should exist.

Declaration
public Output<string> ResourceGroupName { get; }
Property Value
Type Description
Output<System.String>
View Source

SourceResourceId

The ID of an existing Managed Disk to copy create_option is Copy or the recovery point to restore when create_option is Restore

Declaration
public Output<string> SourceResourceId { get; }
Property Value
Type Description
Output<System.String>
View Source

SourceUri

URI to a valid VHD file to be used when create_option is Import.

Declaration
public Output<string> SourceUri { get; }
Property Value
Type Description
Output<System.String>
View Source

StorageAccountId

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

Declaration
public Output<string> StorageAccountId { get; }
Property Value
Type Description
Output<System.String>
View Source

StorageAccountType

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

Declaration
public Output<string> StorageAccountType { get; }
Property Value
Type Description
Output<System.String>
View Source

Tags

A mapping of tags to assign to the resource.

Declaration
public Output<ImmutableDictionary<string, string>> Tags { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>>
View Source

Zones

A collection containing the availability zone to allocate the Managed Disk in.

Declaration
public Output<string> Zones { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, ManagedDiskState, CustomResourceOptions)

Get an existing ManagedDisk resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static ManagedDisk Get(string name, Input<string> id, ManagedDiskState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

ManagedDiskState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
ManagedDisk
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.