powerstore_replication_rule (Data Source)
This datasource is used to query the existing replication rule from PowerStore array. The information fetched from this datasource can be used for getting the details for further processing in resource block.
Note: Only one of
name
orid
can be provided at a time.
Example Usage
/*
Copyright (c) 2025 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 apply --auto-approve
# This datasource reads replication rules either by id or name where user can provide a value to any one of them
# If it is a empty datsource block , then it will read all the replication rules
# If id or name is provided then it reads a particular replication rule with that id or name
# Only one of the attribute can be provided among id and name
# Get all replication rules
data "powerstore_replication_rule" "all" {
}
# Get replication rule details using name
data "powerstore_replication_rule" "rule_by_name" {
name = "terraform_replication_rule"
}
# Get replication rule details using ID
data "powerstore_replication_rule" "rule_by_id" {
id = "2d0780e3-2ce7-4d8b-b2ec-349c5e9e26a9"
}
output "replicationRule" {
value = data.powerstore_replication_rule.all.replication_rules
}
After the successful execution of above said block, We can see the output by executing terraform output
command. Also, we can fetch information via the variable: data.powerstore_replication_rule.test1.attribute_name
where attribute_name is the attribute which user wants to fetch.
Schema
Optional
id
(String) Unique identifier of the replication rule. Conflicts withname
.name
(String) Name of the replication rule. Conflicts withid
.
Read-Only
replication_rules
(Attributes List) List of replication rules. (see below for nested schema)
Nested Schema for replication_rules
Read-Only:
alert_threshold
(Number) The alert threshold for the replication rule.id
(String) Unique identifier of the replication rule.is_read_only
(Boolean) Indicates whether the replication rule is read-only.is_replica
(Boolean) Indicates whether the replication rule is a replica.managed_by
(String) The entity that manages the replication rule.managed_by_id
(String) The ID of the managing entity.name
(String) Name of the replication rule.policies
(Attributes List) The protection policies associated with the replication rule. (see below for nested schema)remote_system
(Attributes) The remote system associated with the replication rule. (see below for nested schema)remote_system_id
(String) The ID of the remote system associated with the replication rule.replication_sessions
(Attributes List) The replication session associated with the replication rule. (see below for nested schema)rpo
(String) The RPO (Recovery Point Objective) of the replication rule.
Nested Schema for replication_rules.policies
Read-Only:
id
(String) The ID of the protection policy.name
(String) The name of the protection policy.
Nested Schema for replication_rules.remote_system
Read-Only:
id
(String) The ID of the remote system.name
(String) The name of the remote system.
Nested Schema for replication_rules.replication_sessions
Read-Only:
id
(String) The ID of the replication session.state
(String) The state of the replication session.