1. Packages
  2. Vra Provider
  3. API Docs
  4. getBlockDevice
vra 0.12.0 published on Monday, Apr 14, 2025 by vmware

vra.getBlockDevice

Explore with Pulumi AI

vra logo
vra 0.12.0 published on Monday, Apr 14, 2025 by vmware

    —layout: “vra”

    page_title: “VMware vRealize Automation: vra.BlockDevice” description: |- Provides a data lookup for vra_block_device.

    Data Source: vra.BlockDevice

    Provides a data lookup for a vra_block_device.

    Example Usage

    S

    Block device data source by its id:

    This is an example of how to read a block device data source using its ID.

    import * as pulumi from "@pulumi/pulumi";
    import * as vra from "@pulumi/vra";
    
    const _this = vra.getBlockDevice({
        id: _var.block_device_id,
    });
    
    import pulumi
    import pulumi_vra as vra
    
    this = vra.get_block_device(id=var["block_device_id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vra/vra"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vra.LookupBlockDevice(ctx, &vra.LookupBlockDeviceArgs{
    			Id: pulumi.StringRef(_var.Block_device_id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vra = Pulumi.Vra;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = Vra.GetBlockDevice.Invoke(new()
        {
            Id = @var.Block_device_id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vra.VraFunctions;
    import com.pulumi.vra.inputs.GetBlockDeviceArgs;
    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 this = VraFunctions.getBlockDevice(GetBlockDeviceArgs.builder()
                .id(var_.block_device_id())
                .build());
    
        }
    }
    
    variables:
      this:
        fn::invoke:
          function: vra:getBlockDevice
          arguments:
            id: ${var.block_device_id}
    

    Block device data source filter by name:

    This is an example of how to read a block device data source using its name.

    import * as pulumi from "@pulumi/pulumi";
    import * as vra from "@pulumi/vra";
    
    const _this = vra.getBlockDevice({
        filter: `name eq '${_var.block_device_name}'`,
    });
    
    import pulumi
    import pulumi_vra as vra
    
    this = vra.get_block_device(filter=f"name eq '{var['block_device_name']}'")
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vra/vra"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vra.LookupBlockDevice(ctx, &vra.LookupBlockDeviceArgs{
    			Filter: pulumi.StringRef(fmt.Sprintf("name eq '%v'", _var.Block_device_name)),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vra = Pulumi.Vra;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = Vra.GetBlockDevice.Invoke(new()
        {
            Filter = $"name eq '{@var.Block_device_name}'",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vra.VraFunctions;
    import com.pulumi.vra.inputs.GetBlockDeviceArgs;
    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 this = VraFunctions.getBlockDevice(GetBlockDeviceArgs.builder()
                .filter(String.format("name eq '%s'", var_.block_device_name()))
                .build());
    
        }
    }
    
    variables:
      this:
        fn::invoke:
          function: vra:getBlockDevice
          arguments:
            filter: name eq '${var.block_device_name}'
    

    Using getBlockDevice

    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 getBlockDevice(args: GetBlockDeviceArgs, opts?: InvokeOptions): Promise<GetBlockDeviceResult>
    function getBlockDeviceOutput(args: GetBlockDeviceOutputArgs, opts?: InvokeOptions): Output<GetBlockDeviceResult>
    def get_block_device(description: Optional[str] = None,
                         expand_snapshots: Optional[bool] = None,
                         filter: Optional[str] = None,
                         id: Optional[str] = None,
                         tags: Optional[Sequence[GetBlockDeviceTag]] = None,
                         opts: Optional[InvokeOptions] = None) -> GetBlockDeviceResult
    def get_block_device_output(description: Optional[pulumi.Input[str]] = None,
                         expand_snapshots: Optional[pulumi.Input[bool]] = None,
                         filter: Optional[pulumi.Input[str]] = None,
                         id: Optional[pulumi.Input[str]] = None,
                         tags: Optional[pulumi.Input[Sequence[pulumi.Input[GetBlockDeviceTagArgs]]]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetBlockDeviceResult]
    func LookupBlockDevice(ctx *Context, args *LookupBlockDeviceArgs, opts ...InvokeOption) (*LookupBlockDeviceResult, error)
    func LookupBlockDeviceOutput(ctx *Context, args *LookupBlockDeviceOutputArgs, opts ...InvokeOption) LookupBlockDeviceResultOutput

    > Note: This function is named LookupBlockDevice in the Go SDK.

    public static class GetBlockDevice 
    {
        public static Task<GetBlockDeviceResult> InvokeAsync(GetBlockDeviceArgs args, InvokeOptions? opts = null)
        public static Output<GetBlockDeviceResult> Invoke(GetBlockDeviceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetBlockDeviceResult> getBlockDevice(GetBlockDeviceArgs args, InvokeOptions options)
    public static Output<GetBlockDeviceResult> getBlockDevice(GetBlockDeviceArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vra:index/getBlockDevice:getBlockDevice
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Description string
    Describes machine within the scope of your organization and is not propagated to the cloud.
    ExpandSnapshots bool
    Indicates whether the snapshots of the block-devices should be included in the state. Applicable only for first class block devices.
    Filter string
    Search criteria to filter the list of block devices.
    Id string
    The id of the block device.
    Tags List<GetBlockDeviceTag>
    A set of tag keys and optional values that were set on this resource instance. example: [ { "key" : "vmware.enumeration.type", "value": "nebs_block" } ]
    Description string
    Describes machine within the scope of your organization and is not propagated to the cloud.
    ExpandSnapshots bool
    Indicates whether the snapshots of the block-devices should be included in the state. Applicable only for first class block devices.
    Filter string
    Search criteria to filter the list of block devices.
    Id string
    The id of the block device.
    Tags []GetBlockDeviceTag
    A set of tag keys and optional values that were set on this resource instance. example: [ { "key" : "vmware.enumeration.type", "value": "nebs_block" } ]
    description String
    Describes machine within the scope of your organization and is not propagated to the cloud.
    expandSnapshots Boolean
    Indicates whether the snapshots of the block-devices should be included in the state. Applicable only for first class block devices.
    filter String
    Search criteria to filter the list of block devices.
    id String
    The id of the block device.
    tags List<GetBlockDeviceTag>
    A set of tag keys and optional values that were set on this resource instance. example: [ { "key" : "vmware.enumeration.type", "value": "nebs_block" } ]
    description string
    Describes machine within the scope of your organization and is not propagated to the cloud.
    expandSnapshots boolean
    Indicates whether the snapshots of the block-devices should be included in the state. Applicable only for first class block devices.
    filter string
    Search criteria to filter the list of block devices.
    id string
    The id of the block device.
    tags GetBlockDeviceTag[]
    A set of tag keys and optional values that were set on this resource instance. example: [ { "key" : "vmware.enumeration.type", "value": "nebs_block" } ]
    description str
    Describes machine within the scope of your organization and is not propagated to the cloud.
    expand_snapshots bool
    Indicates whether the snapshots of the block-devices should be included in the state. Applicable only for first class block devices.
    filter str
    Search criteria to filter the list of block devices.
    id str
    The id of the block device.
    tags Sequence[GetBlockDeviceTag]
    A set of tag keys and optional values that were set on this resource instance. example: [ { "key" : "vmware.enumeration.type", "value": "nebs_block" } ]
    description String
    Describes machine within the scope of your organization and is not propagated to the cloud.
    expandSnapshots Boolean
    Indicates whether the snapshots of the block-devices should be included in the state. Applicable only for first class block devices.
    filter String
    Search criteria to filter the list of block devices.
    id String
    The id of the block device.
    tags List<Property Map>
    A set of tag keys and optional values that were set on this resource instance. example: [ { "key" : "vmware.enumeration.type", "value": "nebs_block" } ]

    getBlockDevice Result

    The following output properties are available:

    CapacityInGb double
    Capacity of the block device in GB.
    CloudAccountIds List<string>
    Set of ids of the cloud accounts this entity belongs to.
    CreatedAt string
    Date when the entity was created. The date is in ISO 6801 and UTC.
    CustomProperties Dictionary<string, string>
    Additional custom properties that may be used to extend the machine.
    DeploymentId string
    The id of the deployment that is associated with this resource.
    ExternalId string
    External entity Id on the provider side.
    ExternalRegionId string
    The external regionId of the resource.
    ExternalZoneId string
    The external zoneId of the resource.
    Id string
    Links List<GetBlockDeviceLink>
    HATEOAS of the entity.
    Name string
    A human-friendly name used as an identifier in APIs that support this option.
    OrgId string
    The id of the organization this entity belongs to.
    Owner string
    Email of the user that owns the entity.
    Persistent bool
    Indicates whether the block device survives a delete action.
    ProjectId string
    The id of the project the current user belongs to.
    Snapshots List<GetBlockDeviceSnapshot>
    Status string
    Status of the block device.
    UpdatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    Description string
    Describes machine within the scope of your organization and is not propagated to the cloud.
    ExpandSnapshots bool
    Filter string
    Tags List<GetBlockDeviceTag>
    A set of tag keys and optional values that were set on this resource instance. example: [ { "key" : "vmware.enumeration.type", "value": "nebs_block" } ]
    CapacityInGb float64
    Capacity of the block device in GB.
    CloudAccountIds []string
    Set of ids of the cloud accounts this entity belongs to.
    CreatedAt string
    Date when the entity was created. The date is in ISO 6801 and UTC.
    CustomProperties map[string]string
    Additional custom properties that may be used to extend the machine.
    DeploymentId string
    The id of the deployment that is associated with this resource.
    ExternalId string
    External entity Id on the provider side.
    ExternalRegionId string
    The external regionId of the resource.
    ExternalZoneId string
    The external zoneId of the resource.
    Id string
    Links []GetBlockDeviceLink
    HATEOAS of the entity.
    Name string
    A human-friendly name used as an identifier in APIs that support this option.
    OrgId string
    The id of the organization this entity belongs to.
    Owner string
    Email of the user that owns the entity.
    Persistent bool
    Indicates whether the block device survives a delete action.
    ProjectId string
    The id of the project the current user belongs to.
    Snapshots []GetBlockDeviceSnapshotType
    Status string
    Status of the block device.
    UpdatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    Description string
    Describes machine within the scope of your organization and is not propagated to the cloud.
    ExpandSnapshots bool
    Filter string
    Tags []GetBlockDeviceTag
    A set of tag keys and optional values that were set on this resource instance. example: [ { "key" : "vmware.enumeration.type", "value": "nebs_block" } ]
    capacityInGb Double
    Capacity of the block device in GB.
    cloudAccountIds List<String>
    Set of ids of the cloud accounts this entity belongs to.
    createdAt String
    Date when the entity was created. The date is in ISO 6801 and UTC.
    customProperties Map<String,String>
    Additional custom properties that may be used to extend the machine.
    deploymentId String
    The id of the deployment that is associated with this resource.
    externalId String
    External entity Id on the provider side.
    externalRegionId String
    The external regionId of the resource.
    externalZoneId String
    The external zoneId of the resource.
    id String
    links List<GetBlockDeviceLink>
    HATEOAS of the entity.
    name String
    A human-friendly name used as an identifier in APIs that support this option.
    orgId String
    The id of the organization this entity belongs to.
    owner String
    Email of the user that owns the entity.
    persistent Boolean
    Indicates whether the block device survives a delete action.
    projectId String
    The id of the project the current user belongs to.
    snapshots List<GetBlockDeviceSnapshot>
    status String
    Status of the block device.
    updatedAt String
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    description String
    Describes machine within the scope of your organization and is not propagated to the cloud.
    expandSnapshots Boolean
    filter String
    tags List<GetBlockDeviceTag>
    A set of tag keys and optional values that were set on this resource instance. example: [ { "key" : "vmware.enumeration.type", "value": "nebs_block" } ]
    capacityInGb number
    Capacity of the block device in GB.
    cloudAccountIds string[]
    Set of ids of the cloud accounts this entity belongs to.
    createdAt string
    Date when the entity was created. The date is in ISO 6801 and UTC.
    customProperties {[key: string]: string}
    Additional custom properties that may be used to extend the machine.
    deploymentId string
    The id of the deployment that is associated with this resource.
    externalId string
    External entity Id on the provider side.
    externalRegionId string
    The external regionId of the resource.
    externalZoneId string
    The external zoneId of the resource.
    id string
    links GetBlockDeviceLink[]
    HATEOAS of the entity.
    name string
    A human-friendly name used as an identifier in APIs that support this option.
    orgId string
    The id of the organization this entity belongs to.
    owner string
    Email of the user that owns the entity.
    persistent boolean
    Indicates whether the block device survives a delete action.
    projectId string
    The id of the project the current user belongs to.
    snapshots GetBlockDeviceSnapshot[]
    status string
    Status of the block device.
    updatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    description string
    Describes machine within the scope of your organization and is not propagated to the cloud.
    expandSnapshots boolean
    filter string
    tags GetBlockDeviceTag[]
    A set of tag keys and optional values that were set on this resource instance. example: [ { "key" : "vmware.enumeration.type", "value": "nebs_block" } ]
    capacity_in_gb float
    Capacity of the block device in GB.
    cloud_account_ids Sequence[str]
    Set of ids of the cloud accounts this entity belongs to.
    created_at str
    Date when the entity was created. The date is in ISO 6801 and UTC.
    custom_properties Mapping[str, str]
    Additional custom properties that may be used to extend the machine.
    deployment_id str
    The id of the deployment that is associated with this resource.
    external_id str
    External entity Id on the provider side.
    external_region_id str
    The external regionId of the resource.
    external_zone_id str
    The external zoneId of the resource.
    id str
    links Sequence[GetBlockDeviceLink]
    HATEOAS of the entity.
    name str
    A human-friendly name used as an identifier in APIs that support this option.
    org_id str
    The id of the organization this entity belongs to.
    owner str
    Email of the user that owns the entity.
    persistent bool
    Indicates whether the block device survives a delete action.
    project_id str
    The id of the project the current user belongs to.
    snapshots Sequence[GetBlockDeviceSnapshot]
    status str
    Status of the block device.
    updated_at str
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    description str
    Describes machine within the scope of your organization and is not propagated to the cloud.
    expand_snapshots bool
    filter str
    tags Sequence[GetBlockDeviceTag]
    A set of tag keys and optional values that were set on this resource instance. example: [ { "key" : "vmware.enumeration.type", "value": "nebs_block" } ]
    capacityInGb Number
    Capacity of the block device in GB.
    cloudAccountIds List<String>
    Set of ids of the cloud accounts this entity belongs to.
    createdAt String
    Date when the entity was created. The date is in ISO 6801 and UTC.
    customProperties Map<String>
    Additional custom properties that may be used to extend the machine.
    deploymentId String
    The id of the deployment that is associated with this resource.
    externalId String
    External entity Id on the provider side.
    externalRegionId String
    The external regionId of the resource.
    externalZoneId String
    The external zoneId of the resource.
    id String
    links List<Property Map>
    HATEOAS of the entity.
    name String
    A human-friendly name used as an identifier in APIs that support this option.
    orgId String
    The id of the organization this entity belongs to.
    owner String
    Email of the user that owns the entity.
    persistent Boolean
    Indicates whether the block device survives a delete action.
    projectId String
    The id of the project the current user belongs to.
    snapshots List<Property Map>
    status String
    Status of the block device.
    updatedAt String
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    description String
    Describes machine within the scope of your organization and is not propagated to the cloud.
    expandSnapshots Boolean
    filter String
    tags List<Property Map>
    A set of tag keys and optional values that were set on this resource instance. example: [ { "key" : "vmware.enumeration.type", "value": "nebs_block" } ]

    Supporting Types

    Href string
    Hrefs List<string>
    Rel string
    Href string
    Hrefs []string
    Rel string
    href String
    hrefs List<String>
    rel String
    href string
    hrefs string[]
    rel string
    href str
    hrefs Sequence[str]
    rel str
    href String
    hrefs List<String>
    rel String

    GetBlockDeviceSnapshot

    CreatedAt string
    Date when the entity was created. The date is in ISO 6801 and UTC.
    Description string
    Describes machine within the scope of your organization and is not propagated to the cloud.
    Id string
    The id of the block device.
    IsCurrent bool
    Links List<GetBlockDeviceSnapshotLink>
    HATEOAS of the entity.
    Name string
    A human-friendly name used as an identifier in APIs that support this option.
    OrgId string
    The id of the organization this entity belongs to.
    Owner string
    Email of the user that owns the entity.
    UpdatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    CreatedAt string
    Date when the entity was created. The date is in ISO 6801 and UTC.
    Description string
    Describes machine within the scope of your organization and is not propagated to the cloud.
    Id string
    The id of the block device.
    IsCurrent bool
    Links []GetBlockDeviceSnapshotLink
    HATEOAS of the entity.
    Name string
    A human-friendly name used as an identifier in APIs that support this option.
    OrgId string
    The id of the organization this entity belongs to.
    Owner string
    Email of the user that owns the entity.
    UpdatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    createdAt String
    Date when the entity was created. The date is in ISO 6801 and UTC.
    description String
    Describes machine within the scope of your organization and is not propagated to the cloud.
    id String
    The id of the block device.
    isCurrent Boolean
    links List<GetBlockDeviceSnapshotLink>
    HATEOAS of the entity.
    name String
    A human-friendly name used as an identifier in APIs that support this option.
    orgId String
    The id of the organization this entity belongs to.
    owner String
    Email of the user that owns the entity.
    updatedAt String
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    createdAt string
    Date when the entity was created. The date is in ISO 6801 and UTC.
    description string
    Describes machine within the scope of your organization and is not propagated to the cloud.
    id string
    The id of the block device.
    isCurrent boolean
    links GetBlockDeviceSnapshotLink[]
    HATEOAS of the entity.
    name string
    A human-friendly name used as an identifier in APIs that support this option.
    orgId string
    The id of the organization this entity belongs to.
    owner string
    Email of the user that owns the entity.
    updatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    created_at str
    Date when the entity was created. The date is in ISO 6801 and UTC.
    description str
    Describes machine within the scope of your organization and is not propagated to the cloud.
    id str
    The id of the block device.
    is_current bool
    links Sequence[GetBlockDeviceSnapshotLink]
    HATEOAS of the entity.
    name str
    A human-friendly name used as an identifier in APIs that support this option.
    org_id str
    The id of the organization this entity belongs to.
    owner str
    Email of the user that owns the entity.
    updated_at str
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    createdAt String
    Date when the entity was created. The date is in ISO 6801 and UTC.
    description String
    Describes machine within the scope of your organization and is not propagated to the cloud.
    id String
    The id of the block device.
    isCurrent Boolean
    links List<Property Map>
    HATEOAS of the entity.
    name String
    A human-friendly name used as an identifier in APIs that support this option.
    orgId String
    The id of the organization this entity belongs to.
    owner String
    Email of the user that owns the entity.
    updatedAt String
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    Href string
    Hrefs List<string>
    Rel string
    Href string
    Hrefs []string
    Rel string
    href String
    hrefs List<String>
    rel String
    href string
    hrefs string[]
    rel string
    href str
    hrefs Sequence[str]
    rel str
    href String
    hrefs List<String>
    rel String

    GetBlockDeviceTag

    Key string
    Tag’s key.
    Value string
    Tag’s value.
    Key string
    Tag’s key.
    Value string
    Tag’s value.
    key String
    Tag’s key.
    value String
    Tag’s value.
    key string
    Tag’s key.
    value string
    Tag’s value.
    key str
    Tag’s key.
    value str
    Tag’s value.
    key String
    Tag’s key.
    value String
    Tag’s value.

    Package Details

    Repository
    vra vmware/terraform-provider-vra
    License
    Notes
    This Pulumi package is based on the vra Terraform Provider.
    vra logo
    vra 0.12.0 published on Monday, Apr 14, 2025 by vmware