powerstore_snapshotrule (Resource)

SnapshotRule resource

Example Usage

# Commands to run this tf file : terraform init && terraform plan && terraform apply
# Create, Update, Delete is supported for this resource
# To import , check snapshot_rule_import.tf for more info
# name and interval OR name, time_of_day, days_of_week and timezone are required attributes to create and update
# To check which attributes of the snapshot rule can be updated, please refer Product Guide in the documentation

resource "powerstore_snapshotrule" "test1" {
  name = "test_snapshotrule_2"
  # interval = "Four_Hours"
  time_of_day       = "21:00"
  timezone          = "UTC"
  days_of_week      = ["Monday"]
  desired_retention = 56
  nas_access_type   = "Snapshot"
  is_read_only      = false
  delete_snaps      = true

//Below example is for import operation
/*resource "powerstore_snapshotrule" "terraform-provider-test-import" {



  • desired_retention (Number) The Desired snapshot retention period in hours to retain snapshots for this time period.
  • name (String) The name of the snapshot rule.


  • days_of_week (List of String) The days of the week when the snapshot rule should be applied.
  • delete_snaps (Boolean) Specify whether all snapshots previously created by this snapshot rule should also be deleted when this rule is removed.
  • interval (String) The interval between snapshots taken by a snapshot rule.
  • is_read_only (Boolean) Indicates whether this snapshot rule can be modified.
  • nas_access_type (String) The NAS filesystem snapshot access method for snapshot rule.
  • time_of_day (String) The time of the day to take a daily snapshot, with format hh:mm.
  • timezone (String) The time zone identifier for applying the time zone to the time_of_day for a snapshot rule.


  • id (String) The ID of the snapshot rule.
  • is_replica (Boolean) Indicates whether this is a replica of a snapshot rule on a remote system.
  • managed_by (String) The entity that owns and manages the instance.
  • managed_by_id (String) The unique id of the managing entity.


Import is supported using the following syntax:

# Below are the steps to import snapshot rule :
# Step 1 - To import a snapshot rule , we need the id of that snapshot rule 
# Step 2 - To check the id of the snapshot rule we can make Get request to snapshot rule endpoint. eg. which will return list of all snapshot rule ids.
# Step 3 - Add empty resource block in tf file. 
# eg. 
# resource "powerstore_snapshotrule" "resource_block_name" {
  # (resource arguments)
# }
# Step 4 - Execute the command: terraform import "powerstore_snapshotrule.resource_block_name" "id_of_the_snapshot_rule" (resource_block_name must be taken from step 3 and id must be taken from step 2)
# Step 5 - After successful execution of the command , check the state file