GetManagedDisk

Use this data source to access information about an existing Managed Disk.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var existing = Output.Create(Azure.Compute.GetManagedDisk.InvokeAsync(new Azure.Compute.GetManagedDiskArgs
        {
            Name = "example-datadisk",
            ResourceGroupName = "example-resources",
        }));
        this.Id = existing.Apply(existing => existing.Id);
    }

    [Output("id")]
    public Output<string> Id { get; set; }
}
package main

import (
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/compute"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        existing, err := compute.LookupManagedDisk(ctx, &compute.LookupManagedDiskArgs{
            Name:              "example-datadisk",
            ResourceGroupName: "example-resources",
        }, nil)
        if err != nil {
            return err
        }
        ctx.Export("id", existing.Id)
        return nil
    })
}
import pulumi
import pulumi_azure as azure

existing = azure.compute.get_managed_disk(name="example-datadisk",
    resource_group_name="example-resources")
pulumi.export("id", existing.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const existing = azure.compute.getManagedDisk({
    name: "example-datadisk",
    resourceGroupName: "example-resources",
});
export const id = existing.then(existing => existing.id);

Using GetManagedDisk

function getManagedDisk(args: GetManagedDiskArgs, opts?: InvokeOptions): Promise<GetManagedDiskResult>
function  get_managed_disk(name=None, resource_group_name=None, tags=None, zones=None, opts=None)
func LookupManagedDisk(ctx *Context, args *LookupManagedDiskArgs, opts ...InvokeOption) (*LookupManagedDiskResult, error)

Note: This function is named LookupManagedDisk in the Go SDK.

public static class GetManagedDisk {
    public static Task<GetManagedDiskResult> InvokeAsync(GetManagedDiskArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string

Specifies the name of the Managed Disk.

ResourceGroupName string

Specifies the name of the Resource Group where this Managed Disk exists.

Tags Dictionary<string, string>

A mapping of tags assigned to the resource.

Zones List<string>

A list of Availability Zones where the Managed Disk exists.

Name string

Specifies the name of the Managed Disk.

ResourceGroupName string

Specifies the name of the Resource Group where this Managed Disk exists.

Tags map[string]string

A mapping of tags assigned to the resource.

Zones []string

A list of Availability Zones where the Managed Disk exists.

name string

Specifies the name of the Managed Disk.

resourceGroupName string

Specifies the name of the Resource Group where this Managed Disk exists.

tags {[key: string]: string}

A mapping of tags assigned to the resource.

zones string[]

A list of Availability Zones where the Managed Disk exists.

name str

Specifies the name of the Managed Disk.

resource_group_name str

Specifies the name of the Resource Group where this Managed Disk exists.

tags Dict[str, str]

A mapping of tags assigned to the resource.

zones List[str]

A list of Availability Zones where the Managed Disk exists.

GetManagedDisk Result

The following output properties are available:

CreateOption string
DiskEncryptionSetId string

The ID of the Disk Encryption Set used to encrypt this Managed Disk.

DiskIopsReadWrite int

The number of IOPS allowed for this disk, where one operation can transfer between 4k and 256k bytes.

DiskMbpsReadWrite int

The bandwidth allowed for this disk.

DiskSizeGb int

The size of the Managed Disk in gigabytes.

Id string

The provider-assigned unique ID for this managed resource.

Name string
OsType string

The operating system used for this Managed Disk.

ResourceGroupName string
SourceResourceId string

The ID of an existing Managed Disk which this Disk was created from.

SourceUri string

The Source URI for this Managed Disk.

StorageAccountId string

The ID of the Storage Account where the source_uri is located.

StorageAccountType string

The storage account type for the Managed Disk.

Zones List<string>

A list of Availability Zones where the Managed Disk exists.

Tags Dictionary<string, string>

A mapping of tags assigned to the resource.

CreateOption string
DiskEncryptionSetId string

The ID of the Disk Encryption Set used to encrypt this Managed Disk.

DiskIopsReadWrite int

The number of IOPS allowed for this disk, where one operation can transfer between 4k and 256k bytes.

DiskMbpsReadWrite int

The bandwidth allowed for this disk.

DiskSizeGb int

The size of the Managed Disk in gigabytes.

Id string

The provider-assigned unique ID for this managed resource.

Name string
OsType string

The operating system used for this Managed Disk.

ResourceGroupName string
SourceResourceId string

The ID of an existing Managed Disk which this Disk was created from.

SourceUri string

The Source URI for this Managed Disk.

StorageAccountId string

The ID of the Storage Account where the source_uri is located.

StorageAccountType string

The storage account type for the Managed Disk.

Zones []string

A list of Availability Zones where the Managed Disk exists.

Tags map[string]string

A mapping of tags assigned to the resource.

createOption string
diskEncryptionSetId string

The ID of the Disk Encryption Set used to encrypt this Managed Disk.

diskIopsReadWrite number

The number of IOPS allowed for this disk, where one operation can transfer between 4k and 256k bytes.

diskMbpsReadWrite number

The bandwidth allowed for this disk.

diskSizeGb number

The size of the Managed Disk in gigabytes.

id string

The provider-assigned unique ID for this managed resource.

name string
osType string

The operating system used for this Managed Disk.

resourceGroupName string
sourceResourceId string

The ID of an existing Managed Disk which this Disk was created from.

sourceUri string

The Source URI for this Managed Disk.

storageAccountId string

The ID of the Storage Account where the source_uri is located.

storageAccountType string

The storage account type for the Managed Disk.

zones string[]

A list of Availability Zones where the Managed Disk exists.

tags {[key: string]: string}

A mapping of tags assigned to the resource.

create_option str
disk_encryption_set_id str

The ID of the Disk Encryption Set used to encrypt this Managed Disk.

disk_iops_read_write float

The number of IOPS allowed for this disk, where one operation can transfer between 4k and 256k bytes.

disk_mbps_read_write float

The bandwidth allowed for this disk.

disk_size_gb float

The size of the Managed Disk in gigabytes.

id str

The provider-assigned unique ID for this managed resource.

name str
os_type str

The operating system used for this Managed Disk.

resource_group_name str
source_resource_id str

The ID of an existing Managed Disk which this Disk was created from.

source_uri str

The Source URI for this Managed Disk.

storage_account_id str

The ID of the Storage Account where the source_uri is located.

storage_account_type str

The storage account type for the Managed Disk.

zones List[str]

A list of Availability Zones where the Managed Disk exists.

tags Dict[str, str]

A mapping of tags assigned to the resource.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.