Skip to content

Latest commit

 

History

History
118 lines (94 loc) · 5.13 KB

protectionpolicy.md

File metadata and controls

118 lines (94 loc) · 5.13 KB
title linkTitle page_title subcategory description
powerstore_protectionpolicy resource
powerstore_protectionpolicy
powerstore_protectionpolicy Resource - powerstore
This resource is used to manage the protection policy entity of PowerStore Array. We can Create, Update and Delete the protection policy using this resource. We can also import an existing protection policy from PowerStore array.

powerstore_protectionpolicy (Resource)

This resource is used to manage the protection policy entity of PowerStore Array. We can Create, Update and Delete the protection policy using this resource. We can also import an existing protection policy from PowerStore array.

Example Usage

/*
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 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"]
}

After the execution of above resource block, protection policy would have been created on the PowerStore array. For more information, Please check the terraform state file.

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:

#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 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