powerstore_protectionpolicy (Resource)

ProtectionPolicy 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 protection_policy_import.tf for more info
# name and snapshot_rule_ids or replication_rule_ids or snapshot_rule_names or replication_rule_names are required attributes to create and update
# To check which attributes of the protection policy can be updated, please refer Product Guide in the documentation

resource "powerstore_protectionpolicy" "terraform-provider-test1" {
  # (resource arguments)
  description            = "Creating Protection Policy"
  name                   = "test_protection_policy1"
  snapshot_rule_names    = ["vsi_aut_snaprule", "snapshot_test_emi", "test_snapshotrule_1", "snap-use-for-nfs-test"]
  replication_rule_names = ["Emalee-SRA-7416-Rep"]
}

Schema

Required

  • name (String) The name of the protection policy.

Optional

  • description (String) The description of the protection policy.
  • replication_rule_ids (Set of String) List of the replication rule IDs that are associated with this policy.
  • replication_rule_names (Set of String) List of the replication rule names that are associated with this policy.
  • snapshot_rule_ids (Set of String) List of the snapshot rule IDs that are associated with this policy.
  • snapshot_rule_names (Set of String) List of the snapshot rule names that are associated with this policy.

Read-Only

  • id (String) Unique identifier of the policy.
  • is_read_only (Boolean) Indicates whether this policy can be modified.
  • type (String) The type of the protection policy.

Import

Import is supported using the following syntax:

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