powerstore_smb_share (Data Source)
This datasource is used to query the existing SMB Shares from a 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
,id
,file_system_id
orfilter_expression
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
# fetching all SMB Shares on the array
data "powerstore_smb_share" "all_smb_shares" {
}
# fetching SMB Share using id
data "powerstore_smb_share" "smb_share_by_id" {
id = "6732e829-29c9-7fed-686a-ee23cab1d298"
}
# fetching SMB Shares using name
data "powerstore_smb_share" "smb_share_by_name" {
name = "smb-share-1"
}
# fetching all SMB Shares of a filesystem
# Step 1: Fetching the filesystem whose SMB Shares are to be fetched.
data "powerstore_filesystem" "us_east_sales_catalog" {
name = "us-east-sales-catalog"
lifecycle {
postcondition {
condition = length(self.filesystems) == 1
error_message = "error: US East sales catalog filesystem list length should be 1, received: ${length(self.filesystems)}"
}
}
}
# Step 2: Fetching the SMB Shares using the filesystem id from step 1
data "powerstore_smb_share" "smb_share_by_filesystem" {
file_system_id = data.powerstore_filesystem.us_east_sales_catalog.filesystems[0].id
}
# fetching SMB Shares using filter expression
# Please refer to the guides section for filter expression syntax
# here, we are fetching all SMB Shares of subdirectories of /us-east-revenue/sports_cars
# with encryption enabled and offline availability as either Documents or None.
data "powerstore_smb_share" "smb_share_by_filters" {
filter_expression = "path=ilike./us-east-revenue/sports_cars/*&is_encryption_enabled=is.true&offline_availability=in.(Documents,None)"
}
output "all_smb_shares" {
value = data.powerstore_smb_share.all_smb_shares.smb_shares
}
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_smb_share.smb_share_by_filters.attribute_name
where attribute_name is the attribute which user wants to fetch.
Schema
Optional
file_system_id
(String) The ID of the file system whose SMB Shares are to be fetched. Conflicts withid
,name
andfilter_expression
.filter_expression
(String) PowerStore filter expression to filter SMB shares by. Conflicts withid
,name
andfile_system_id
.id
(String) Unique identifier of the SMB share to be fetched. Conflicts withname
,file_system_id
andfilter_expression
.name
(String) Name of the SMB share to be fetch. Conflicts withid
,file_system_id
andfilter_expression
.
Read-Only
smb_shares
(Attributes List) List of SMB shares fetched from PowerStore array. (see below for nested schema)
Nested Schema for smb_shares
Read-Only:
description
(String) User defined SMB share description.file_system_id
(String) The unique identifier of the file system on which the SMB Share is created.id
(String) The unique identifier of the SMB Share.is_abe_enabled
(Boolean) Whether Access-based Enumeration (ABE) is enabled.is_branch_cache_enabled
(Boolean) Whether BranchCache optimization is enabled. BranchCache optimization technology copies content from your main office or hosted cloud content servers and caches the content at branch office locations, allowing client computers at branch offices to access the content locally rather than over the WAN.is_continuous_availability_enabled
(Boolean) Whether continuous availability for Server Message Block (SMB) 3.0 is enabled for the SMB Share.is_encryption_enabled
(Boolean) Whether encryption for Server Message Block (SMB) 3.0 is enabled at the shared folder level.name
(String) The name of the SMB Share.offline_availability
(String) Defines valid states of Offline Availability, where the states are:Manual
- Only specified files will be available offline.Documents
- All files that users open will be available offline.Programs
- Program will preferably run from the offline cache even when connected to the network. All files that users open will be available offline.None
- Prevents clients from storing documents and programs in offline cache.offline_availability_l10n
(String) Localized message string corresponding to offline_availabilitypath
(String) The local path of the filesystem or any existing sub-folder of the file system exported via the SMB Share. This path is relative to the NAS Server.umask
(String) The default UNIX umask for new files created on the Share.