vra 0.12.0 published on Monday, Apr 14, 2025 by vmware
vra.getBlockDevice
Explore with Pulumi AI
—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 dictionaryThe following arguments are supported:
- Description string
 - 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 string
 - Search criteria to filter the list of block devices.
 - Id string
 - The id of the block device.
 - 
List<Get
Block 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.
 - 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 string
 - Search criteria to filter the list of block devices.
 - Id string
 - The id of the block device.
 - 
[]Get
Block 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.
 - expand
Snapshots 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<Get
Block 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.
 - expand
Snapshots 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.
 - 
Get
Block 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[Get
Block 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.
 - expand
Snapshots 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:
- Capacity
In doubleGb  - Capacity of the block device in GB.
 - Cloud
Account List<string>Ids  - Set of ids of the cloud accounts this entity belongs to.
 - Created
At string - Date when the entity was created. The date is in ISO 6801 and UTC.
 - Custom
Properties Dictionary<string, string> - Additional custom properties that may be used to extend the machine.
 - Deployment
Id string - The id of the deployment that is associated with this resource.
 - External
Id string - External entity Id on the provider side.
 - External
Region stringId  - The external regionId of the resource.
 - External
Zone stringId  - The external zoneId of the resource.
 - Id string
 - Links
List<Get
Block Device Link>  - HATEOAS of the entity.
 - Name string
 - A human-friendly name used as an identifier in APIs that support this option.
 - Org
Id 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.
 - Project
Id string - The id of the project the current user belongs to.
 - Snapshots
List<Get
Block Device Snapshot>  - Status string
 - Status of the block device.
 - Updated
At 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.
 - Expand
Snapshots bool - Filter string
 - 
List<Get
Block 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 float64Gb  - Capacity of the block device in GB.
 - Cloud
Account []stringIds  - Set of ids of the cloud accounts this entity belongs to.
 - Created
At string - Date when the entity was created. The date is in ISO 6801 and UTC.
 - Custom
Properties map[string]string - Additional custom properties that may be used to extend the machine.
 - Deployment
Id string - The id of the deployment that is associated with this resource.
 - External
Id string - External entity Id on the provider side.
 - External
Region stringId  - The external regionId of the resource.
 - External
Zone stringId  - The external zoneId of the resource.
 - Id string
 - Links
[]Get
Block Device Link  - HATEOAS of the entity.
 - Name string
 - A human-friendly name used as an identifier in APIs that support this option.
 - Org
Id 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.
 - Project
Id string - The id of the project the current user belongs to.
 - Snapshots
[]Get
Block Device Snapshot Type  - Status string
 - Status of the block device.
 - Updated
At 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.
 - Expand
Snapshots bool - Filter string
 - 
[]Get
Block 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 DoubleGb  - Capacity of the block device in GB.
 - cloud
Account List<String>Ids  - Set of ids of the cloud accounts this entity belongs to.
 - created
At String - Date when the entity was created. The date is in ISO 6801 and UTC.
 - custom
Properties Map<String,String> - Additional custom properties that may be used to extend the machine.
 - deployment
Id String - The id of the deployment that is associated with this resource.
 - external
Id String - External entity Id on the provider side.
 - external
Region StringId  - The external regionId of the resource.
 - external
Zone StringId  - The external zoneId of the resource.
 - id String
 - links
List<Get
Block Device Link>  - HATEOAS of the entity.
 - name String
 - A human-friendly name used as an identifier in APIs that support this option.
 - org
Id 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.
 - project
Id String - The id of the project the current user belongs to.
 - snapshots
List<Get
Block Device Snapshot>  - status String
 - Status of the block device.
 - updated
At 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.
 - expand
Snapshots Boolean - filter String
 - 
List<Get
Block 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 numberGb  - Capacity of the block device in GB.
 - cloud
Account string[]Ids  - Set of ids of the cloud accounts this entity belongs to.
 - created
At string - Date when the entity was created. The date is in ISO 6801 and UTC.
 - custom
Properties {[key: string]: string} - Additional custom properties that may be used to extend the machine.
 - deployment
Id string - The id of the deployment that is associated with this resource.
 - external
Id string - External entity Id on the provider side.
 - external
Region stringId  - The external regionId of the resource.
 - external
Zone stringId  - The external zoneId of the resource.
 - id string
 - links
Get
Block Device Link[]  - HATEOAS of the entity.
 - name string
 - A human-friendly name used as an identifier in APIs that support this option.
 - org
Id 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.
 - project
Id string - The id of the project the current user belongs to.
 - snapshots
Get
Block Device Snapshot[]  - status string
 - Status of the block device.
 - updated
At 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.
 - expand
Snapshots boolean - filter string
 - 
Get
Block 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[Get
Block Device Link]  - 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[Get
Block 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[Get
Block 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 NumberGb  - Capacity of the block device in GB.
 - cloud
Account List<String>Ids  - Set of ids of the cloud accounts this entity belongs to.
 - created
At String - Date when the entity was created. The date is in ISO 6801 and UTC.
 - custom
Properties Map<String> - Additional custom properties that may be used to extend the machine.
 - deployment
Id String - The id of the deployment that is associated with this resource.
 - external
Id String - External entity Id on the provider side.
 - external
Region StringId  - The external regionId of the resource.
 - external
Zone StringId  - 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.
 - org
Id 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.
 - project
Id String - The id of the project the current user belongs to.
 - snapshots List<Property Map>
 - status String
 - Status of the block device.
 - updated
At 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.
 - expand
Snapshots 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   
- Created
At 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.
 - Is
Current bool - Links
List<Get
Block Device Snapshot Link>  - HATEOAS of the entity.
 - Name string
 - A human-friendly name used as an identifier in APIs that support this option.
 - Org
Id string - The id of the organization this entity belongs to.
 - Owner string
 - Email of the user that owns the entity.
 - Updated
At string - Date when the entity was last updated. The date is ISO 8601 and UTC.
 
- Created
At 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.
 - Is
Current bool - Links
[]Get
Block Device Snapshot Link  - HATEOAS of the entity.
 - Name string
 - A human-friendly name used as an identifier in APIs that support this option.
 - Org
Id string - The id of the organization this entity belongs to.
 - Owner string
 - Email of the user that owns the entity.
 - Updated
At string - Date when the entity was last updated. The date is ISO 8601 and UTC.
 
- created
At 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.
 - is
Current Boolean - links
List<Get
Block Device Snapshot Link>  - HATEOAS of the entity.
 - name String
 - A human-friendly name used as an identifier in APIs that support this option.
 - org
Id String - The id of the organization this entity belongs to.
 - owner String
 - Email of the user that owns the entity.
 - updated
At String - Date when the entity was last updated. The date is ISO 8601 and UTC.
 
- created
At 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.
 - is
Current boolean - links
Get
Block Device Snapshot Link[]  - HATEOAS of the entity.
 - name string
 - A human-friendly name used as an identifier in APIs that support this option.
 - org
Id string - The id of the organization this entity belongs to.
 - owner string
 - Email of the user that owns the entity.
 - updated
At 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[Get
Block Device Snapshot Link]  - 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.
 
- created
At 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.
 - is
Current 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.
 - org
Id String - The id of the organization this entity belongs to.
 - owner String
 - Email of the user that owns the entity.
 - updated
At 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.