Skip to content

Latest commit

 

History

History
147 lines (112 loc) · 5.05 KB

File metadata and controls

147 lines (112 loc) · 5.05 KB
title linkTitle page_title subcategory description
powerflex_sdc data source
powerflex_sdc
powerflex_sdc Data Source - powerflex
This datasource is used to query the existing Storage Data Clients from the PowerFlex array. The information fetched from this datasource can be used for getting the details / for further processing in resource block.

powerflex_sdc (Data Source)

This datasource is used to query the existing Storage Data Clients from the PowerFlex array. The information fetched from this datasource can be used for getting the details / for further processing in resource block.

Example Usage

/*
Copyright (c) 2023-2024 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

data "powerflex_sdc" "all" {

}

# Returns all sdcs
output "allsdcresult" {
  value = data.powerflex_sdc.all
}

# if a filter is of type string it has the ability to allow regular expressions
# data "powerflex_sdc" "sdc_filter_regex" {
#   filter{
#     name = ["^System_.*$"]
#     system_id = ["^.*0f$"]
#   }
# }

# output "sdcFilterRegexResult"{
#  value = data.powerflex_sdc.sdc_filter_regex.sdcs
# }

// If multiple filter fields are provided then it will show the intersection of all of those fields.
// If there is no intersection between the filters then an empty datasource will be returned
// For more information about how we do our datasource filtering check out our guides: https://dell.github.io/terraform-docs/docs/storage/platforms/powerflex/product_guide/examples/
data "powerflex_sdc" "filtered" {
  filter {
    # id = ["ID1", "ID2"]
    # system_id = ["systemID", "systemID2"]
    # sdc_ip = ["SCDIP1", "SCDIP2"]
    # sdc_approved = false
    # on_vmware = false
    # sdc_guid = ["SdcGUID1", "SdcGUID2"]
    # mdm_connection_state = ["MdmConnectionState1", "MdmConnectionState2"]
    # name = ["Name1", "Name2"]
  }
}

# Returns filtered sdcs matching criteria
output "filteredsdcresult" {
  value = data.powerflex_sdc.filtered.sdcs
}
# -----------------------------------------------------------------------------------

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.powerflex_sdc.selected.attribute_name where attribute_name is the attribute which user wants to fetch.

Schema

Optional

Read-Only

  • id (String) ID placeholder for sdc datasource
  • sdcs (Attributes List) List of fetched SDCs. (see below for nested schema)

Nested Schema for filter

Optional:

  • id (Set of String) List of id
  • mdm_connection_state (Set of String) List of mdm_connection_state
  • name (Set of String) List of name
  • on_vmware (Boolean) Value for on_vmware
  • sdc_approved (Boolean) Value for sdc_approved
  • sdc_guid (Set of String) List of sdc_guid
  • sdc_ip (Set of String) List of sdc_ip
  • system_id (Set of String) List of system_id

Nested Schema for sdcs

Read-Only:

  • id (String) The ID of the fetched SDC.
  • links (Attributes List) The Links of the fetched SDC. (see below for nested schema)
  • mdm_connection_state (String) The MDM connection status of the fetched SDC.
  • name (String) The name of the fetched SDC.
  • on_vmware (Boolean) If the fetched SDC is on vmware.
  • sdc_approved (Boolean) If the fetched SDC is approved.
  • sdc_guid (String) The GUID of the fetched SDC.
  • sdc_ip (String) The IP of the fetched SDC.
  • system_id (String) The System ID of the fetched SDC.

Nested Schema for sdcs.links

Read-Only:

  • href (String) The Links-HREF of the fetched SDC.
  • rel (String) The Links-Rel of the fetched SDC.