vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware
vcd.getIndependentDisk
Explore with Pulumi AI
Provides a VMware Cloud Director Independent disk data source. An independent disk data source can be used to reference an independent disk and use its data within other resources or data sources.
Supported in provider v2.5+
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as vcd from "@pulumi/vcd";
export = async () => {
const existing_disk = await vcd.getIndependentDisk({
org: "my-org",
vdc: "my-vdc",
id: "urn:vcloud:disk:1bbc273d-7701-4f06-97be-428b46b0805e",
name: "my-disk",
});
return {
"disk-iops": existing_disk.iops,
typeIsAttached: existing_disk.isAttached,
};
}
import pulumi
import pulumi_vcd as vcd
existing_disk = vcd.get_independent_disk(org="my-org",
vdc="my-vdc",
id="urn:vcloud:disk:1bbc273d-7701-4f06-97be-428b46b0805e",
name="my-disk")
pulumi.export("disk-iops", existing_disk.iops)
pulumi.export("typeIsAttached", existing_disk.is_attached)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/vcd/v3/vcd"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
existing_disk, err := vcd.LookupIndependentDisk(ctx, &vcd.LookupIndependentDiskArgs{
Org: pulumi.StringRef("my-org"),
Vdc: pulumi.StringRef("my-vdc"),
Id: pulumi.StringRef("urn:vcloud:disk:1bbc273d-7701-4f06-97be-428b46b0805e"),
Name: pulumi.StringRef("my-disk"),
}, nil)
if err != nil {
return err
}
ctx.Export("disk-iops", existing_disk.Iops)
ctx.Export("typeIsAttached", existing_disk.IsAttached)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vcd = Pulumi.Vcd;
return await Deployment.RunAsync(() =>
{
var existing_disk = Vcd.GetIndependentDisk.Invoke(new()
{
Org = "my-org",
Vdc = "my-vdc",
Id = "urn:vcloud:disk:1bbc273d-7701-4f06-97be-428b46b0805e",
Name = "my-disk",
});
return new Dictionary<string, object?>
{
["disk-iops"] = existing_disk.Apply(existing_disk => existing_disk.Apply(getIndependentDiskResult => getIndependentDiskResult.Iops)),
["typeIsAttached"] = existing_disk.Apply(existing_disk => existing_disk.Apply(getIndependentDiskResult => getIndependentDiskResult.IsAttached)),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vcd.VcdFunctions;
import com.pulumi.vcd.inputs.GetIndependentDiskArgs;
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) {
final var existing-disk = VcdFunctions.getIndependentDisk(GetIndependentDiskArgs.builder()
.org("my-org")
.vdc("my-vdc")
.id("urn:vcloud:disk:1bbc273d-7701-4f06-97be-428b46b0805e")
.name("my-disk")
.build());
ctx.export("disk-iops", existing_disk.iops());
ctx.export("typeIsAttached", existing_disk.isAttached());
}
}
variables:
existing-disk:
fn::invoke:
function: vcd:getIndependentDisk
arguments:
org: my-org
vdc: my-vdc
id: urn:vcloud:disk:1bbc273d-7701-4f06-97be-428b46b0805e
name: my-disk
outputs:
disk-iops: ${["existing-disk"].iops}
typeIsAttached: ${["existing-disk"].isAttached}
Using getIndependentDisk
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getIndependentDisk(args: GetIndependentDiskArgs, opts?: InvokeOptions): Promise<GetIndependentDiskResult>
function getIndependentDiskOutput(args: GetIndependentDiskOutputArgs, opts?: InvokeOptions): Output<GetIndependentDiskResult>
def get_independent_disk(id: Optional[str] = None,
name: Optional[str] = None,
org: Optional[str] = None,
vdc: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetIndependentDiskResult
def get_independent_disk_output(id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
org: Optional[pulumi.Input[str]] = None,
vdc: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetIndependentDiskResult]
func LookupIndependentDisk(ctx *Context, args *LookupIndependentDiskArgs, opts ...InvokeOption) (*LookupIndependentDiskResult, error)
func LookupIndependentDiskOutput(ctx *Context, args *LookupIndependentDiskOutputArgs, opts ...InvokeOption) LookupIndependentDiskResultOutput
> Note: This function is named LookupIndependentDisk
in the Go SDK.
public static class GetIndependentDisk
{
public static Task<GetIndependentDiskResult> InvokeAsync(GetIndependentDiskArgs args, InvokeOptions? opts = null)
public static Output<GetIndependentDiskResult> Invoke(GetIndependentDiskInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetIndependentDiskResult> getIndependentDisk(GetIndependentDiskArgs args, InvokeOptions options)
public static Output<GetIndependentDiskResult> getIndependentDisk(GetIndependentDiskArgs args, InvokeOptions options)
fn::invoke:
function: vcd:index/getIndependentDisk:getIndependentDisk
arguments:
# arguments dictionary
The following arguments are supported:
- Id string
- Disk id or name is required. If both provided - Id is used. Id can be found by using import function Listing independent disk IDs
- Name string
- Disk name. Warning please use
id
as there is possibility to have more than one independent disk with same name. As result data source will fail. - Org string
- The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
- Vdc string
- The name of VDC to use, optional if defined at provider level
- Id string
- Disk id or name is required. If both provided - Id is used. Id can be found by using import function Listing independent disk IDs
- Name string
- Disk name. Warning please use
id
as there is possibility to have more than one independent disk with same name. As result data source will fail. - Org string
- The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
- Vdc string
- The name of VDC to use, optional if defined at provider level
- id String
- Disk id or name is required. If both provided - Id is used. Id can be found by using import function Listing independent disk IDs
- name String
- Disk name. Warning please use
id
as there is possibility to have more than one independent disk with same name. As result data source will fail. - org String
- The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
- vdc String
- The name of VDC to use, optional if defined at provider level
- id string
- Disk id or name is required. If both provided - Id is used. Id can be found by using import function Listing independent disk IDs
- name string
- Disk name. Warning please use
id
as there is possibility to have more than one independent disk with same name. As result data source will fail. - org string
- The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
- vdc string
- The name of VDC to use, optional if defined at provider level
- id str
- Disk id or name is required. If both provided - Id is used. Id can be found by using import function Listing independent disk IDs
- name str
- Disk name. Warning please use
id
as there is possibility to have more than one independent disk with same name. As result data source will fail. - org str
- The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
- vdc str
- The name of VDC to use, optional if defined at provider level
- id String
- Disk id or name is required. If both provided - Id is used. Id can be found by using import function Listing independent disk IDs
- name String
- Disk name. Warning please use
id
as there is possibility to have more than one independent disk with same name. As result data source will fail. - org String
- The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
- vdc String
- The name of VDC to use, optional if defined at provider level
getIndependentDisk Result
The following output properties are available:
- Attached
Vm List<string>Ids - Bus
Sub stringType - Bus
Type string - Datastore
Name string - Description string
- Encrypted bool
- Iops double
- Is
Attached bool - Metadata Dictionary<string, string>
- Metadata
Entries List<GetIndependent Disk Metadata Entry> - Owner
Name string - string
- Size
In doubleMb - Storage
Profile string - Uuid string
- Id string
- Name string
- Org string
- Vdc string
- Attached
Vm []stringIds - Bus
Sub stringType - Bus
Type string - Datastore
Name string - Description string
- Encrypted bool
- Iops float64
- Is
Attached bool - Metadata map[string]string
- Metadata
Entries []GetIndependent Disk Metadata Entry - Owner
Name string - string
- Size
In float64Mb - Storage
Profile string - Uuid string
- Id string
- Name string
- Org string
- Vdc string
- attached
Vm List<String>Ids - bus
Sub StringType - bus
Type String - datastore
Name String - description String
- encrypted Boolean
- iops Double
- is
Attached Boolean - metadata Map<String,String>
- metadata
Entries List<GetIndependent Disk Metadata Entry> - owner
Name String - String
- size
In DoubleMb - storage
Profile String - uuid String
- id String
- name String
- org String
- vdc String
- attached
Vm string[]Ids - bus
Sub stringType - bus
Type string - datastore
Name string - description string
- encrypted boolean
- iops number
- is
Attached boolean - metadata {[key: string]: string}
- metadata
Entries GetIndependent Disk Metadata Entry[] - owner
Name string - string
- size
In numberMb - storage
Profile string - uuid string
- id string
- name string
- org string
- vdc string
- attached_
vm_ Sequence[str]ids - bus_
sub_ strtype - bus_
type str - datastore_
name str - description str
- encrypted bool
- iops float
- is_
attached bool - metadata Mapping[str, str]
- metadata_
entries Sequence[GetIndependent Disk Metadata Entry] - owner_
name str - str
- size_
in_ floatmb - storage_
profile str - uuid str
- id str
- name str
- org str
- vdc str
- attached
Vm List<String>Ids - bus
Sub StringType - bus
Type String - datastore
Name String - description String
- encrypted Boolean
- iops Number
- is
Attached Boolean - metadata Map<String>
- metadata
Entries List<Property Map> - owner
Name String - String
- size
In NumberMb - storage
Profile String - uuid String
- id String
- name String
- org String
- vdc String
Supporting Types
GetIndependentDiskMetadataEntry
- Is
System bool - Key string
- Type string
- User
Access string - Value string
- Is
System bool - Key string
- Type string
- User
Access string - Value string
- is
System Boolean - key String
- type String
- user
Access String - value String
- is
System boolean - key string
- type string
- user
Access string - value string
- is_
system bool - key str
- type str
- user_
access str - value str
- is
System Boolean - key String
- type String
- user
Access String - value String
Package Details
- Repository
- vcd vmware/terraform-provider-vcd
- License
- Notes
- This Pulumi package is based on the
vcd
Terraform Provider.