Skip to content

Latest commit

 

History

History
141 lines (115 loc) · 5.73 KB

File metadata and controls

141 lines (115 loc) · 5.73 KB
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.

powerstore_nas_server (Data Source)

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.

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 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.

Schema

Optional

  • filter_expression (String) PowerStore filter expression to filter NAS Servers by. Conflicts with id and name.
  • id (String) Unique identifier of the NAS Server. Conflicts with name.
  • name (String) NAS Server name. Conflicts with id.

Read-Only

Nested Schema for nas_servers

Read-Only:

  • backup_ipv4_interface_id (String) Backup IPv4 Interface ID
  • backup_ipv6_interface_id (String) Backup IPv6 Interface ID
  • current_node_id (String) Current Node ID
  • current_preferred_ipv4_interface_id (String) Current Preferred IPv4Interface ID
  • current_preferred_ipv6_interface_id (String) Current Preferred IPv6Interface ID
  • current_unix_directory_service (String) Current Unix Directory Service
  • current_unix_directory_service_l10n (String) Current Unix Directory Service L10n
  • default_unix_user (String) Default Unix User
  • default_windows_user (String) Default Windows User
  • description (String) Description
  • file_events_publishing_mode (String) File Events Publishing Mode
  • file_events_publishing_mode_l10n (String) File Events Publishing Mode L10n
  • id (String) Unique identifier of the NAS Server
  • is_auto_user_mapping_enabled (Boolean) Is Auto User Mapping Enabled
  • is_dr_test (Boolean) Is DR Test
  • is_production_mode_enabled (Boolean) Is Production Mode Enabled
  • is_replication_destination (Boolean) Is Replication Destination
  • is_username_translation_enabled (Boolean) Is Username Translation Enabled
  • name (String) NAS Server name
  • operational_status (String) Operational Status
  • operational_status_l10n (String) Operational Status L10n
  • preferred_node_id (String) Preferred Node ID
  • production_ipv4_interface_id (String) Production IPv4 Interface ID
  • production_ipv6_interface_id (String) Production IPv6 Interface ID
  • protection_policy_id (String) Protection Policy ID