powerscale_snapshot_schedule (Resource)

This resource is used to manage the Snapshot Schedule entity on PowerScale array. We can Create, Update and Delete the Snapshot Schedules using this resource. We can also import an existing Snapshot Schedule from PowerScale array.

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

# Available actions: Create, Update, Delete and Import
# After `terraform apply` of this example file it will create NFS export on specified paths on the PowerScale Array.
# For more information, Please check the terraform state file.

# PowerScale SMB shares provide clients network access to file system resources on the cluster
resource "powerscale_snapshot_schedule" "snap_schedule" {
  # Required name of snapshot schedule for creating
  name = "test_snap_schedule"

  # Optional fields

  # The path snapshotted. Default set to : "/ifs"
  # path = "/ifs/tfacc_test"

  # Time value in String for which snapshots created by this snapshot schedule should be retained. Values supported are of format : 
  # "Never Expires, x Seconds(s), x Minute(s), x Hour(s), x Week(s), x Day(s), x Month(s), x Year(s) where x can be any integer value.
  # Default set to : "1 Week(s)"
  # retention_time = "3 Hour(s)" 

  # Alias name to create for each snapshot.
  # alias = "snap_alias"

  # Pattern expanded with strftime to create snapshot names. Some sample values for pattern are: 'snap-%F' would yield snap-1984-03-20 , 'backup-%FT%T' would yield backup-1984-03-20T22:30:00".
  # Default set to : "ScheduleName_duration_%Y-%m-%d_%H:%M"
  # pattern = "ScheduleName_duration_%Y-%m-%d_%H:%M"

  # The isidate compatible natural language description of the schedule.It specifies the frequency of the schedule.You can specify this as combination of <interval> and <frequency> where each of them can be defined as:  
  #  <interval>:
  # 	  *Every [ ( other | <integer> ) ] ( weekday | day | week [ on <day>] | month [ on the <integer> ] | <day>[, ...] [ of every [ ( other | <integer> ) ] week ] | The last (day | weekday | <day>) of every [ (other | <integer>) ] month | The <integer> (weekday | <day>) of every [ (other | <integer>) ] month | The <integer> of every [ (other | <integer>) ] month | Yearly on <month> <integer> | Yearly on the (last | <integer>) [ weekday | <day> ] of <month>
  #  <frequency>:
  # 			*at <hh>[:<mm>] [ (AM | PM) ] | every [ <integer> ] (hours | minutes) [ between <hh>[:<mm>] [ (AM | PM) ] and <hh>[:<mm>] [ (AM | PM) ] | every [ <integer> ] (hours | minutes) [ from <hh>[:<mm>] [ (AM | PM) ] to <hh>[:<mm>] [ (AM | PM) ]
  #  Additionally:
  # 			<integer> can include "st," "th," or "rd," e.g., "Every 1st month."
  # 			<day> can be a day of the week or a three-letter abbreviation, e.g., "saturday" or "sat."
  # 			<month> must be the name of the month or its abbreviation, e.g., "July" or "Jul."
  # 	Some sample values:  "Every 2 days", "Every 3rd weekday at 11 PM", "Every month on the 15th at 1:30 AM"`
  # Default set to : "every 1 days at 12:00 AM"
  # schedule = "every 1 days at 12:00 AM"

}

# After the execution of above resource block, an SMB share would have been created on the PowerScale array.
# For more information, Please check the terraform state file.

Schema

Required

  • name (String) The schedule name.

Optional

  • alias (String) Alias name to create for each snapshot.
  • duration (Number) Time in seconds added to creation time to construction expiration time.
  • next_run (Number) Unix Epoch time of next snapshot to be created.
  • next_snapshot (String) Formatted name (see pattern) of next snapshot to be created
  • path (String) The /ifs path snapshotted.
  • pattern (String) Pattern expanded with strftime to create snapshot names.Some sample values for pattern are: ‘snap-%F’ would yield snap-1984-03-20 , ‘backup-%FT%T’ would yield backup-1984-03-20T22:30:00
  • retention_time (String) Time value in String for which snapshots created by this snapshot schedule should be retained.Values supported are of format : Never Expires, x Seconds(s), x Minute(s), x Hour(s), x Week(s), x Day(s), x Month(s), x Year(s) where x can be any integer value
  • schedule (String) The isidate-compatible natural language description of the schedule. It specifies the frequency of the schedule. You can specify this as combination of and where each of them can be defined as: : *Every [ ( other | ) ] ( weekday | day | week [ on ] | month [ on the ] | [, …] [ of every [ ( other | ) ] week ] | The last (day | weekday | ) of every [ (other | ) ] month | The (weekday | ) of every [ (other | ) ] month | The of every [ (other | ) ] month | Yearly on | Yearly on the (last | ) [ weekday | ] of : *at [:] [ (AM | PM) ] | every [ ] (hours | minutes) [ between [:] [ (AM | PM) ] and [:] [ (AM | PM) ] | every [ ] (hours | minutes) [ from [:] [ (AM | PM) ] to [:] [ (AM | PM) ] Additionally: can include “st,” “th,” or “rd,” e.g., “Every 1st month.” can be a day of the week or a three-letter abbreviation, e.g., “saturday” or “sat.” must be the name of the month or its abbreviation, e.g., “July” or “Jul.” Some sample values: “Every 2 days.”, “Every 3rd weekday at 11 PM.”, “Every month on the 15th at 1:30 AM.”

Read-Only

  • id (String) The system ID given to the schedule.

Import

Import is supported using the following syntax:

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

# The command is
# terraform import powerscale_snapshot_schedule.snap_schedule <id>
# Example:
terraform import powerscale_snapshot_schedule.snap_schedule id
# after running this command, populate the name field and other required parameters in the config file to start managing this resource.
# Note: running "terraform show" after importing shows the current config/state of the resource. You can copy/paste that config to make it easier to manage the resource.