| title | powerstore_nas_server data source |
|---|---|
| linkTitle | powerstore_nas_server |
| page_title | powerstore_nas_server Data Source - powerstore |
| subcategory | File Storage Management |
| description | This datasource is used to query the existing NAS Server from PowerStore array. The information fetched from this datasource can be used for getting the details for further processing in resource block. |
This datasource is used to query the existing NAS Server from PowerStore array. The information fetched from this datasource can be used for getting the details for further processing in resource block.
/*
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 NAS Servers 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 NAS Servers
# If id or name is provided then it reads a particular NAS Server with that id or name
# Only one of the attribute can be provided among id and name
# Fetching all NAS Servers
data "powerstore_nas_server" "all" {
}
# Fetching NAS Server by id
data "powerstore_nas_server" "nas_server_by_id" {
id = "282479293"
}
# Fetching NAS Server by name
data "powerstore_nas_server" "nas_server_by_name" {
name = "nas_server_1"
}
# Get NAS Servers details using filter expression
# This filter expression will fetch all the NAS Servers that have `operational_status` as `Started` and
# `is_replication_destination` as `false`
data "powerstore_nas_server" "nas_server_by_filter" {
filter_expression = "and=(operational_status.eq.Started, is_replication_destination.eq.false)"
}
# Output all NAS Server details
output "nas_server_all_details" {
value = data.powerstore_nas_server.all.nas_servers
}
# Output only NAS Server IDs
output "nas_server_IDs_only" {
value = data.powerstore_nas_server.all.nas_servers.*.id
}
# Output NAS Server name and current node ID with nas server ID as key
output "nas_server_name_and_current_node_id" {
value = {
for nas_server in data.powerstore_nas_server.all.nas_servers : nas_server.id => {
name = nas_server.name
current_node_id = nas_server.current_node_id
}
}
}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_nas_server.test1.attribute_name where attribute_name is the attribute which user wants to fetch.
filter_expression(String) PowerStore filter expression to filter NAS Servers by. Conflicts withidandname.id(String) Unique identifier of the NAS Server. Conflicts withname.name(String) NAS Server name. Conflicts withid.
nas_servers(Attributes List) List of NAS Servers. (see below for nested schema)
Read-Only:
backup_ipv4_interface_id(String) Backup IPv4 Interface IDbackup_ipv6_interface_id(String) Backup IPv6 Interface IDcurrent_node_id(String) Current Node IDcurrent_preferred_ipv4_interface_id(String) Current Preferred IPv4Interface IDcurrent_preferred_ipv6_interface_id(String) Current Preferred IPv6Interface IDcurrent_unix_directory_service(String) Current Unix Directory Servicecurrent_unix_directory_service_l10n(String) Current Unix Directory Service L10ndefault_unix_user(String) Default Unix Userdefault_windows_user(String) Default Windows Userdescription(String) Descriptionfile_events_publishing_mode(String) File Events Publishing Modefile_events_publishing_mode_l10n(String) File Events Publishing Mode L10nid(String) Unique identifier of the NAS Serveris_auto_user_mapping_enabled(Boolean) Is Auto User Mapping Enabledis_dr_test(Boolean) Is DR Testis_production_mode_enabled(Boolean) Is Production Mode Enabledis_replication_destination(Boolean) Is Replication Destinationis_username_translation_enabled(Boolean) Is Username Translation Enabledname(String) NAS Server nameoperational_status(String) Operational Statusoperational_status_l10n(String) Operational Status L10npreferred_node_id(String) Preferred Node IDproduction_ipv4_interface_id(String) Production IPv4 Interface IDproduction_ipv6_interface_id(String) Production IPv6 Interface IDprotection_policy_id(String) Protection Policy ID