title | linkTitle | page_title | subcategory | description |
---|---|---|---|---|
powerstore_snapshotrule resource |
powerstore_snapshotrule |
powerstore_snapshotrule Resource - powerstore |
This resource is used to manage the snapshot rule entity of PowerStore Array. We can Create, Update and Delete the snapshot rule using this resource. We can also import an existing snapshot rule from PowerStore array. |
This resource is used to manage the snapshot rule entity of PowerStore Array. We can Create, Update and Delete the snapshot rule using this resource. We can also import an existing snapshot rule from PowerStore array.
/*
Copyright (c) 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 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" {
}*/
After the execution of above resource block snapshot rule would have been created on the PowerStore array. For more information, Please check the terraform state file.
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:
#Copyright (c) 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.
# 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. https://10.0.0.1/api/rest/snapshot_rule 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