powerstore_recycle_bin (Data Source)

This datasource is used to query the recycle bin contents from a PowerStore array. The information fetched from this datasource can be used for recovering or permanently deleting items.

Example Usage

/*
Copyright (c) 2026 Dell Inc., or its subsidiaries. All Rights Reserved.

Licensed under the Mozilla Public License Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://mozilla.org/MPL/2.0/


Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

# commands to run this tf file : terraform init && terraform apply --auto-approve
# This datasource reads Recycle Bin items from the PowerStore array
# If it is an empty datasource block, then it will read all recycle bin items
# If id is provided then it reads a particular recycle bin item
# If resource_type is provided, it filters by volume or volume_group
# filter_expression can be used for advanced filtering

# Fetch all recycle bin items
data "powerstore_recycle_bin" "all" {
}

# Fetch recycle bin items filtered by resource type (volumes only)
data "powerstore_recycle_bin" "volumes_only" {
  resource_type = "volume"
}

# Fetch recycle bin items filtered by resource type (volume groups only)
data "powerstore_recycle_bin" "volume_groups_only" {
  resource_type = "volume_group"
}

# Fetch recycle bin items using filter expression
data "powerstore_recycle_bin" "filtered" {
  filter_expression = "resource_type=eq.volume"
}

# Output all recycle bin items
output "recycle_bin_all" {
  value = data.powerstore_recycle_bin.all.recycle_bin_items
}

# Output only recycle bin item IDs
output "recycle_bin_ids" {
  value = data.powerstore_recycle_bin.all.recycle_bin_items.*.id
}

# Output recycle bin item names and types
output "recycle_bin_summary" {
  value = {
    for item in data.powerstore_recycle_bin.all.recycle_bin_items : item.id => {
      name          = item.name
      resource_type = item.resource_type
      expires       = item.expiration_timestamp
    }
  }
}

Schema

Optional

  • filter_expression (String) PowerStore filter expression to filter recycle bin items. Conflicts with id.
  • id (String) Unique identifier of a specific recycle bin item. Conflicts with resource_type and filter_expression.
  • resource_type (String) Filter recycle bin items by resource type. Valid values are volume and volume_group. Conflicts with id.

Read-Only

Nested Schema for recycle_bin_items

Read-Only:

  • appliance_id (String) The appliance where this resource is located.
  • deletion_timestamp (String) Time when the object was moved to the recycle bin.
  • expiration_timestamp (String) Time when the object will be auto-purged.
  • id (String) Unique identifier for the recycle bin item.
  • logical_provisioned (Number) Provisioned size of the object in bytes.
  • logical_used (Number) Logical space used by the object in bytes.
  • name (String) The name of the deleted object.
  • resource_type (String) Type of the storage object (volume or volume_group).
  • resource_type_l10n (String) Localized message string corresponding to resource_type.