This document version is no longer actively maintained.
The site that you are currently viewing is an archived snapshot.
For up-to-date documentation, see the latest version.
powerstore_volume_snapshot (Resource)
volume snapshot resource
Note:
volume_id
/volume_name
is the required attribute to create volume snapshot.
Note: ifname
is present in the config it cannot be blank(""). if absent, default value is allocated to it.
Note: During create operation, ifexpiration_timestamp
is not specified or set to blank(""), snapshot will be created with infinite retention.
Note: During modify operation, to set infinite retention,expiration_timestamp
can be set to blank("").
Note: Volume DataSource can be used to fetch volume ID/Name for volume snapshot creation.
Note: Exactly one ofvolume_id
andvolume_name
should be provided.
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 volume_snapshot_import.tf for more info
# volume_id/volume_name is the required attribute to create volume snapshot.
# name, expiration_timestamp, performance_policy_id and description are the optional attributes
# if name is present in the config it cannot be blank("").
# During create operation, if expiration_timestamp is not specified or set to blank(""), snapshot will be created with infinite retention.
# During modify operation, to set infinite retention, expiration_timestamp can be set to blank("").
# Either volume_id or volume_name should be present.
# Volume DataSource can be used to fetch volume ID/Name
# To check which attributes of the volume snapshot resource can be updated, please refer Product Guide in the documentation
resource "powerstore_volume_snapshot" "test" {
name = "test_snap"
description = "powerstore volume snapshot"
volume_id = "01d88dea-7d71-4a1b-abd6-be07f94aecd9"
performance_policy_id = "default_medium"
expiration_timestamp = "2023-05-06T09:01:47Z"
}
Schema
Optional
creator_type
(String) Creator Type of the volume snapshot.description
(String) Description of the volume snapshot.expiration_timestamp
(String) Expiration Timestamp of the volume snapshot.Only UTC (+Z) format is allowed.name
(String) Name of the volume snapshot.The default name of the volume snapshot is the date and time when the snapshot is taken.performance_policy_id
(String) Performance Policy id of the volume snapshot. Valid values are default_medium, default_low, default_high.volume_id
(String) ID of the volume to take snapshot. Conflicts withvolume_name
. Cannot be updated.volume_name
(String) Name of the volume to take snapshot. Conflicts withvolume_id
. Cannot be updated.
Read-Only
id
(String) The unique identifier of the volume snapshot.
Import
Import is supported using the following syntax:
# Below are the steps to import snapshot :
# Step 1 - To import a volume snapshot , we need the id of that volume snapshot
# Step 2 - To check the id of the volume snapshot we can make Get request to volume snapshot endpoint. eg. https://10.0.0.1/api/rest/volume --header 'type: Snapshot' which will return list of all volume snapshots ids.
# Step 3 - Add empty resource block in tf file.
# eg.
# resource "powerstore_volume_snapshot" "resource_block_name" {
# (resource arguments)
# }
# Step 4 - Execute the command: terraform import "powerstore_volume_snapshot.resource_block_name" "id_of_the_snapshot" (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