vra 0.15.0 published on Tuesday, Aug 19, 2025 by vmware
vra.getBlockDevice
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 dictionaryThe 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.
- 
List<GetBlock Device Tag> 
- 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.
- 
[]GetBlock Device Tag 
- 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.
- 
List<GetBlock Device Tag> 
- 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.
- 
GetBlock Device Tag[] 
- 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.
- 
Sequence[GetBlock Device Tag] 
- 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.
- 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:
- CapacityIn doubleGb 
- Capacity of the block device in GB.
- CloudAccount List<string>Ids 
- 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.
- ExternalRegion stringId 
- The external regionId of the resource.
- ExternalZone stringId 
- The external zoneId of the resource.
- Id string
- Links
List<GetBlock Device Link> 
- Hypermedia as the Engine of Application State (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<GetBlock Device Snapshot> 
- 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
- 
List<GetBlock Device Tag> 
- A set of tag keys and optional values that were set on this resource instance. Example: [ { "key" : "vmware.enumeration.type", "value": "nebs_block" } ]
- CapacityIn float64Gb 
- Capacity of the block device in GB.
- CloudAccount []stringIds 
- 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.
- ExternalRegion stringId 
- The external regionId of the resource.
- ExternalZone stringId 
- The external zoneId of the resource.
- Id string
- Links
[]GetBlock Device Link 
- Hypermedia as the Engine of Application State (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
[]GetBlock Device Snapshot Type 
- 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
- 
[]GetBlock Device Tag 
- A set of tag keys and optional values that were set on this resource instance. Example: [ { "key" : "vmware.enumeration.type", "value": "nebs_block" } ]
- capacityIn DoubleGb 
- Capacity of the block device in GB.
- cloudAccount List<String>Ids 
- 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.
- externalRegion StringId 
- The external regionId of the resource.
- externalZone StringId 
- The external zoneId of the resource.
- id String
- links
List<GetBlock Device Link> 
- Hypermedia as the Engine of Application State (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<GetBlock Device Snapshot> 
- 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
- 
List<GetBlock Device Tag> 
- A set of tag keys and optional values that were set on this resource instance. Example: [ { "key" : "vmware.enumeration.type", "value": "nebs_block" } ]
- capacityIn numberGb 
- Capacity of the block device in GB.
- cloudAccount string[]Ids 
- 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.
- externalRegion stringId 
- The external regionId of the resource.
- externalZone stringId 
- The external zoneId of the resource.
- id string
- links
GetBlock Device Link[] 
- Hypermedia as the Engine of Application State (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
GetBlock Device Snapshot[] 
- 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
- 
GetBlock Device Tag[] 
- 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_ floatgb 
- Capacity of the block device in GB.
- cloud_account_ Sequence[str]ids 
- 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_ strid 
- The external regionId of the resource.
- external_zone_ strid 
- The external zoneId of the resource.
- id str
- links
Sequence[GetBlock Device Link] 
- Hypermedia as the Engine of Application State (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[GetBlock Device Snapshot] 
- 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
- 
Sequence[GetBlock Device Tag] 
- A set of tag keys and optional values that were set on this resource instance. Example: [ { "key" : "vmware.enumeration.type", "value": "nebs_block" } ]
- capacityIn NumberGb 
- Capacity of the block device in GB.
- cloudAccount List<String>Ids 
- 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.
- externalRegion StringId 
- The external regionId of the resource.
- externalZone StringId 
- The external zoneId of the resource.
- id String
- links List<Property Map>
- Hypermedia as the Engine of Application State (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
- 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
GetBlockDeviceLink   
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<GetBlock Device Snapshot Link> 
- Hypermedia as the Engine of Application State (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
[]GetBlock Device Snapshot Link 
- Hypermedia as the Engine of Application State (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<GetBlock Device Snapshot Link> 
- Hypermedia as the Engine of Application State (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
GetBlock Device Snapshot Link[] 
- Hypermedia as the Engine of Application State (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[GetBlock Device Snapshot Link] 
- Hypermedia as the Engine of Application State (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>
- Hypermedia as the Engine of Application State (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.
GetBlockDeviceSnapshotLink    
GetBlockDeviceTag   
Package Details
- Repository
- vra vmware/terraform-provider-vra
- License
- Notes
- This Pulumi package is based on the vraTerraform Provider.
