powermax_snapshotpolicy (Data Source)

Data source for a specific Snapshot Policy in PowerMax array. PowerMax snapshot policy feature provides snapshot orchestration at scale (1,024 snaps per storage group). The resource simplifies snapshot management for standard and cloud snapshots.

Example Usage

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

# This terraform DataSource is used to query the existing snapshot_policy from PowerMax array.
# The information fetched from this data source can be used for getting the details / for further processing in resource block.

# Returns all of the PowerMax snapshot policies and their details
data "powermax_snapshotpolicy" "SnapshotPolicyAll" {
  # Optional Update the read timeout with (XXm) for minutes or (XXs) for timeout in seconds
  # If unset defaults to 2 minute timeout
  # timeouts = {
  #   read = "3m"
  # }
}

output "SnapshotPolicyAll" {
  value = data.powermax_snapshotpolicy.SnapshotPolicyAll
}

# Returns a subset of the PowerMax snapshot policies based on the names provided in the `names` filter block and their details
data "powermax_snapshotpolicy" "SnapshotPolicyFiltered" {
  # Optional Update the read timeout with (XXm) for minutes or (XXs) for timeout in seconds
  # If unset defaults to 2 minute timeout
  # timeouts = {
  #   read = "3m"
  # }
  filter {
    # Optional list of names to filter upon
    names = [
      "tfacc_snapshotPolicy1",
    ]
  }
}

output "SnapshotPolicyFiltered" {
  value = data.powermax_snapshotpolicy.SnapshotPolicyFiltered
}

# After the successful execution of above said block, We can see the output value by executing 'terraform output' command.
# Also, we can use the fetched information by the variable data.powermax_snapshotpolicy.example

Schema

Optional

Read-Only

  • id (String) Identifier
  • snapshot_policies (Attributes List) List of Snapshot Policies (see below for nested schema)

Nested Schema for filter

Optional:

  • names (Set of String)

Nested Schema for timeouts

Optional:

  • read (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as “30s” or “2h45m”. Valid time units are “s” (seconds), “m” (minutes), “h” (hours).

Nested Schema for snapshot_policies

Read-Only:

  • compliance_count_critical (Number) The threshold of good snapshots which are not failed/bad for compliance to change from warning to critical
  • compliance_count_warning (Number) The threshold of good snapshots which are not failed/bad for compliance to change from normal to warning.
  • interval_minutes (Number) Number of minutes between each policy execution
  • last_time_used (String) The last time that the snapshot policy was run
  • offset_minutes (Number) Number of minutes after 00:00 on Monday morning that the policy will execute
  • provider_name (String) The name of the cloud provider associated with this policy. Only applies to cloud policies
  • retention_days (Number) The number of days that snapshots will be retained in the cloud for. Only applies to cloud policies
  • secure (Boolean) Set if the snapshot policy creates secure snapshots
  • snapshot_count (Number) Number of snapshots that will be taken before the oldest ones are no longer required
  • snapshot_policy_name (String) Name of the snapshot policy
  • storage_group_count (Number) The total number of storage groups that this snapshot policy is associated with
  • suspended (Boolean) Set if the snapshot policy has been suspended
  • type (String) The type of Snapshots that are created with the policy, local or cloud