oci_file_storage_replication
This resource provides the Replication resource in Oracle Cloud Infrastructure File Storage service.
Creates a new replication in the specified compartment.
Replications are the primary resource that governs the policy of cross-region replication between source
and target file systems. Replications are associated with a secondary resource called a ReplicationTarget
located in another availability domain.
The associated replication target resource is automatically created along with the replication resource.
The replication retrieves the delta of data between two snapshots of a source file system
and sends it to the associated ReplicationTarget
, which retrieves the delta and applies it to the target
file system.
Only unexported file systems can be used as target file systems.
For more information, see Using Replication.
For information about access control and compartments, see Overview of the IAM Service.
For information about availability domains, see Regions and
Availability Domains.
To get a list of availability domains, use the
ListAvailabilityDomains
operation in the Identity and Access
Management Service API.
All Oracle Cloud Infrastructure Services resources, including replications, get an Oracle-assigned, unique ID called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID in the response. You can also retrieve a resource’s OCID by using a List API operation on that resource type, or by viewing the resource in the Console.
Example Usage
resource "oci_file_storage_replication" "test_replication" {
#Required
compartment_id = var.compartment_id
source_id = oci_file_storage_file_system.test_source.id
target_id = oci_file_storage_file_system.test_target.id
#Optional
defined_tags = {"Operations.CostCenter"= "42"}
display_name = var.replication_display_name
freeform_tags = {"Department"= "Finance"}
locks {
#Required
type = var.replication_locks_type
#Optional
message = var.replication_locks_message
related_resource_id = oci_cloud_guard_resource.test_resource.id
time_created = var.replication_locks_time_created
}
replication_interval = var.replication_replication_interval
}
Argument Reference
The following arguments are supported:
compartment_id
- (Required) (Updatable) The OCID of the compartment that contains the replication.defined_tags
- (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:{"Operations.CostCenter": "42"}
display_name
- (Optional) (Updatable) A user-friendly name. It does not have to be unique, and it is changeable. Avoid entering confidential information. An associated replication target will also created with the samedisplayName
. Example:My replication
freeform_tags
- (Optional) (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:{"Department": "Finance"}
locks
- (Optional) Locks associated with this resource.message
- (Optional) A message added by the creator of the lock. This is typically used to give an indication of why the resource is locked.related_resource_id
- (Optional) The ID of the resource that is locking this resource. Indicates that deleting this resource will remove the lock.time_created
- (Optional) When the lock was created.type
- (Required) Type of the lock.
replication_interval
- (Optional) (Updatable) Duration in minutes between replication snapshots.source_id
- (Required) The OCID of the source file system.target_id
- (Required) The OCID of the target file system.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
Attributes Reference
The following attributes are exported:
availability_domain
- The availability domain the replication is in. The replication must be in the same availability domain as the source file system. Example:Uocm:PHX-AD-1
compartment_id
- The OCID of the compartment that contains the replication.defined_tags
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:{"Operations.CostCenter": "42"}
delta_progress
- Percentage progress of the current replication cycle.delta_status
- The current state of the snapshot during replication operations.display_name
- A user-friendly name. It does not have to be unique, and it is changeable. Avoid entering confidential information. Example:My replication
freeform_tags
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:{"Department": "Finance"}
id
- The OCID of the replication.last_snapshot_id
- The OCID of the last snapshot that has been replicated completely. Empty if the copy of the initial snapshot is not complete.lifecycle_details
- Additional information about the current ‘lifecycleState’.locks
- Locks associated with this resource.message
- A message added by the creator of the lock. This is typically used to give an indication of why the resource is locked.related_resource_id
- The ID of the resource that is locking this resource. Indicates that deleting this resource will remove the lock.time_created
- When the lock was created.type
- Type of the lock.
recovery_point_time
- ThesnapshotTime
of the most recent recoverable replication snapshot in RFC 3339 timestamp format. Example:2021-04-04T20:01:29.100Z
replication_interval
- Duration in minutes between replication snapshots.replication_target_id
- The OCID of theReplicationTarget
.source_id
- The OCID of the source file system.state
- The current state of this replication. This resource can be in aFAILED
state if replication target is deleted instead of the replication resource.target_id
- The OCID of the target file system.time_created
- The date and time the replication was created in RFC 3339 timestamp format. Example:2021-01-04T20:01:29.100Z
Timeouts
The timeouts
block allows you to specify timeouts for certain operations:
* create
- (Defaults to 20 minutes), when creating the Replication
* update
- (Defaults to 20 minutes), when updating the Replication
* delete
- (Defaults to 20 minutes), when destroying the Replication
Import
Replications can be imported using the id
, e.g.
$ terraform import oci_file_storage_replication.test_replication "id"