powerstore_filesystem_snapshot (Data Source)
This datasource is used to query the existing File System Snapshot from PowerStore array. The information fetched from this datasource can be used for getting the details for further processing in resource block.
Note: Only one of
name
orid
can be provided at a time.
Example Usage
/*
Copyright (c) 2025 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 hosts either by id or name where user can provide a value to any one of them
# If it is a empty datsource block , then it will read all the filesystem
# If id or name is provided then it reads a particular file system snapshot with that id or name
# If filesystem_id is provided then it will read all the filesystem snapshots within filesystem
# Only one of the attribute can be provided among id or name
# Fetching filesystem snapshot(s) using name
data "powerstore_filesystem_snapshot" "sales_catalog_snapshots_q4" {
name = "sales_catalog_snapshot_q4"
}
#Fetching filesystem snapshot using id
data "powerstore_filesystem_snapshot" "fs_snap_by_id" {
id = "6568282e-c982-62ce-5ar3-52518f324723"
}
# Fetching all snapshots of a particular filesystem
# Step 1: Fetching the filesystem whose snapshots are to be fetched.
data "powerstore_filesystem" "us_east_sales_catalog_fs" {
name = "us_east_sales_catalog_fs"
lifecycle {
postcondition {
condition = length(self.filesystems) == 1
error_message = "Expected one filesystem with name us_east_sales_catalog_fs, but got ${length(self.filesystems)}"
}
}
}
# Step 2: Fetching the filesystem snapshots using the file system id from step 1
data "powerstore_filesystem_snapshot" "us_east_sales_catalog_snapshots" {
filesystem_id = data.powerstore_filesystem.us_east_sales_catalog_fs.filesystems[0].id
}
# Fetching all filesystem snapshots under a particular nas server
# Step 1: Fetching the NAS server whose children snapshots are to be fetched.
data "powerstore_nas_server" "nas_server_us_east" {
name = "nas_server_us_east"
lifecycle {
postcondition {
condition = length(self.nas_servers) == 1
error_message = "Expected a single NAS server for US East region, but got none"
}
}
}
# Step 2: Fetching the filesystem snapshots using the nas server id from step 1
data "powerstore_filesystem_snapshot" "us_east_nas_server_fs_snapshots" {
nas_server_id = data.powerstore_nas_server.nas_server_us_east.nas_servers[0].id
}
# Fetching the filesystem snapshot with a particular name under a given nas server
data "powerstore_filesystem_snapshot" "sales_catalog_snapshot_q4_under_nas_server" {
name = "sales_catalog_snapshot_q4"
nas_server_id = data.powerstore_nas_server.nas_server_us_east.nas_servers[0].id
}
# Fetching snapshot with given name for a particular file system
data "powerstore_filesystem_snapshot" "sales_catalog_snapshot_q4_under_filesystem" {
name = "sales_catalog_snapshot_q4"
filesystem_id = data.powerstore_filesystem.us_east_sales_catalog_fs.filesystems[0].id
}
# Fetching all filesystems
data "powerstore_filesystem_snapshot" "all" {
}
output "result" {
value = data.powerstore_filesystem_snapshot.all.filesystems
}
After the successful execution of above said block, We can see the output by executing terraform output
command. Also, we can fetch information via the variable: data.powerstore_filesystem_snapshot.test1.attribute_name
where attribute_name is the attribute which user wants to fetch.
Schema
Optional
filesystem_id
(String) File System ID of the Snapshot. Conflicts withid
andnas_server_id
.id
(String) Unique identifier of the File System Snapshot. Conflicts withname
andfilesystem_id
.name
(String) File System Snapshot name. Conflicts withid
.nas_server_id
(String) Nas Server ID of the Snapshot. Conflicts withid
andfilesystem_id
.
Read-Only
filesystem_snapshots
(Attributes List) List of File System Snapshots. (see below for nested schema)
Nested Schema for filesystem_snapshots
Read-Only:
access_policy
(String) Access Policy of the File Systemaccess_type
(String) Access Type of the File Systemconfig_type
(String) Config Type of the File Systemcreation_timestamp
(String) Creation Timestamp of the File Systemcreator_type
(String) Creator Type of the File Systemdefault_hard_limit
(Number) Default Hard Limit of the File Systemdefault_soft_limit
(Number) Default Soft Limit of the File Systemdescription
(String) Description of the File Systemexpiration_timestamp
(String) Expiration Timestamp of the File Systemfile_events_publishing_mode
(String) State of the event notification services for all file systemsfilesystem_type
(String) Filesystem Type of the File Systemflr_attributes
(Attributes) Flr Attributes of the File System (see below for nested schema)folder_rename_policy
(String) Folder Rename Policy of the File Systemgrace_period
(Number) Grace Period of the File Systemhost_io_size
(String) Typical size of writesid
(String) ID of the File Systemis_async_m_time_enabled
(Boolean) Is Async MTime Enabled of the File Systemis_modified
(Boolean) Is Modified of the File Systemis_quota_enabled
(Boolean) Is Quota Enabled of the File Systemis_smb_no_notify_enabled
(Boolean) Is Smb No Notify Enabled of the File Systemis_smb_notify_on_access_enabled
(Boolean) Is Smb Notify On Access Enabled of the File Systemis_smb_notify_on_write_enabled
(Boolean) Is Smb Notify On Write Enabled of the File Systemis_smb_op_locks_enabled
(Boolean) Is Smb Op Locks Enabled of the File Systemis_smb_sync_writes_enabled
(Boolean) Is Smb Sync Writes Enabled of the File Systemlast_refresh_timestamp
(String) Last Refresh Timestamp of the File Systemlast_writable_timestamp
(String) Last Writable Timestamp of the File Systemlocking_policy
(String) Locking Policy of the File Systemname
(String) Name of the File Systemnas_server_id
(String) Nas Server ID of the File Systemparent_id
(String) Parent ID of the File Systemprotection_policy_id
(String) Protection Policy ID of the File Systemsize_total
(Number) Size Total of the File Systemsize_used
(Number) Size Used of the File Systemsmb_notify_on_change_dir_depth
(Number) Smb Notify On Change Dir Depth of the File System
Nested Schema for filesystem_snapshots.flr_attributes
Read-Only:
auto_delete
(Boolean) Auto Delete of the File Systemauto_lock
(Boolean) Auto Lock of the File Systemclock_time
(String) Clock Time of the File Systemdefault_retention
(String) Default Retention of the File Systemhas_protected_files
(Boolean) Has Protected Files of the File Systemmaximum_retention
(String) Maximum Retention of the File Systemmaximum_retention_date
(String) Maximum Retention Date of the File Systemminimum_retention
(String) Minimum Retention of the File Systemmode
(String) Mode of the File Systempolicy_interval
(Number) Policy Interval of the File System