powerstore_volumegroup_snapshot (Resource)

Volume Group Snapshot resource

Note: volume_group_id/volume_group_name is the required attribute to create volume group snapshot.
Note: expiration_timestamp if present in config cannot be blank(""). if absent, default value is allocated to it.
Note: During create operation, if expiration_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 group DataSource can be used to fetch volume group ID/Name.
Note: Exactly one of volume_group_id and volume_group_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 volumegroup_snapshot_import.tf for more info
# name and volume_group_id/volume_group_name are the required attributes to create volume group snapshot.
# description and expiration_timestamp are the optional attributes.
# Either volume_group_id or volume_group_name should be present.
# VolumeGroup DataSource can be used to fetch volume group ID/Name.
# 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("").
# To check which attributes of the volume group snapshot resource can be updated, please refer Product Guide in the documentation

resource "powerstore_volumegroup_snapshot" "test" {
  name                 = "test_snap"
  volume_group_id      = "075aeb23-c782-4cce-9372-5a2e31dc5138"
  expiration_timestamp = "2023-05-06T09:01:47Z"
}

Schema

Required

  • name (String) Name of the volume group snapshot.

Optional

  • description (String) Description of the volume group snapshot.
  • expiration_timestamp (String) Expiration Timestamp of the volume group snapshot.Only UTC (+Z) format is allowed
  • volume_group_id (String) ID of the volume group to take snapshot. Conflicts with volume_group_name. Cannot be updated.
  • volume_group_name (String) Name of the volume group to take snapshot. Conflicts with volume_group_id. Cannot be updated.

Read-Only

  • id (String) The unique identifier of the volume group snapshot.

Import

Import is supported using the following syntax:

# Below are the steps to import volume group snapshot :
# Step 1 - To import a volume group snapshot , we need the id of that volume group snapshot
# Step 2 - To check the id of the volume group snapshot we can make Get request to volume group snapshot endpoint. eg. https://10.0.0.1/api/rest/volume_group --header 'type: Snapshot' which will return list of all volume group snapshots ids.
# Step 3 - Add empty resource block in tf file.
# eg.
#resource "powerstore_volumegroup_snapshot" "resource_block_name" {
  # (resource arguments)
#}
# Step 4 - Execute the command: terraform import "powerstore_volumegroup_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