powerstore_nfs_export (Data Source)
This datasource is used to query the existing NFS Exports from a PowerStore Array. The information fetched from this datasource can be used for getting the details for further processing in resource block.
Note:
id
andfilter_expression
cannot be used with any other attribute.name
andfile_system_id
can be used together.
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 NFS exports on the array
data "powerstore_nfs_export" "all_nfs_exports" {
}
# fetching NFS export using id
data "powerstore_nfs_export" "nfs_export_by_id" {
id = "67974f74-6688-b677-9d08-5692f12c6aa4"
}
# fetching NFS exports using name
data "powerstore_nfs_export" "nfs_export_by_name" {
name = "nfs-export-1"
}
# fetching all NFS exports from a filesystem
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)}"
}
}
}
data "powerstore_nfs_export" "nfs_export_by_filesystem" {
file_system_id = data.powerstore_filesystem.us_east_sales_catalog.filesystems[0].id
}
# name and filesystem_id filters can be used together
data "powerstore_nfs_export" "nfs_export_by_filesystem_and_name" {
file_system_id = data.powerstore_filesystem.us_east_sales_catalog.filesystems[0].id
name = "nfs-export-1"
}
# fetching NFS exports using filter expression
# Please refer to the guides section for filter expression syntax
# here, we are fetching all NFS exports of subdirectories of /us-east-revenue/sports_cars
# with min_security as Sys and default_access as Root
data "powerstore_nfs_export" "nfs_export_by_name_regex" {
filter_expression = "path=ilike./us-east-revenue/sports_cars/*&min_security=eq.Sys&default_access=eq.Root"
}
output "nfs_exports_with_name_regex" {
value = data.powerstore_nfs_export.nfs_export_by_name_regex.nfs_exports
}
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_nfs_export.nfs_export_by_name_regex.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 NFS Exports are to be fetched. Conflicts withid
andfilter_expression
.filter_expression
(String) PowerStore filter expression to filter NFS exports by. Conflicts withid
,name
andfile_system_id
.id
(String) Unique identifier of the NFS export to be fetched. Conflicts withname
,file_system_id
andfilter_expression
.name
(String) Name of the NFS export to be fetch. Conflicts withid
andfilter_expression
.
Read-Only
nfs_exports
(Attributes List) List of NFS exports fetched from PowerStore array. (see below for nested schema)
Nested Schema for nfs_exports
Read-Only:
anonymous_gid
(Number) The GID (Group ID) of the anonymous user. This is the group ID of the anonymous user. The anonymous user is the user ID (UID) that is used when the true user’s identity cannot be determined.anonymous_uid
(Number) The UID (User ID) of the anonymous user. This is the user ID of the anonymous user. The anonymous user is the user ID (UID) that is used when the true user’s identity cannot be determined.default_access
(String) The default access level for all hosts that can access the NFS Export. The default access level is the access level that is assigned to a host that is not explicitly Seted in the ’no_access_hosts’, ‘read_only_hosts’, ‘read_only_root_hosts’, ‘read_write_hosts’, or ‘read_write_root_hosts’ Sets. Valid values are: ‘No_Access’, ‘Read_Only’, ‘Read_Write’, ‘Root’, ‘Read_Only_Root’.description
(String) A user-defined description of the NFS Export.file_system_id
(String) The unique identifier of the file system on which the NFS Export is created.id
(String) The unique identifier of the NFS Export.is_no_suid
(Boolean) If Set, do not allow access to Set SUID. Otherwise, allow access.min_security
(String) The NFS enforced security type for users accessing the NFS Export.name
(String) The name of the NFS Export.nfs_owner_username
(String) The default owner of the NFS Export associated with the datastore. For NFSv3 or NFSv4 without Kerberos, the default owner is root.no_access_hosts
(List of String) List of hosts with no access to this NFS export or its snapshots.path
(String) The local path of the filesystem exported via the NFS Export.read_only_hosts
(List of String) List of Read-Only hostsread_only_root_hosts
(List of String) List of Read-Only, allow Roots hostsread_write_hosts
(List of String) List of Read-Write hostsread_write_root_hosts
(List of String) List of Read-Write, allow Root hosts