Data replication (Go SDK V1)
Data replication asynchronously and automatically replicates objects and their operations, such as creation, overwriting, and deletion, from a source bucket to a destination bucket in near real time. Object Storage Service (OSS) supports cross-region replication (CRR) and same-region replication (SRR).
Usage notes
-
In this topic, the public endpoint of the China (Hangzhou) region is used. If you want to access OSS from other Alibaba Cloud services in the same region as OSS, use an internal endpoint. For more information about OSS regions and endpoints, see Regions and endpoints.
-
In this topic, access credentials are obtained from environment variables. For more information about how to configure access credentials, see Configure access credentials.
-
This topic demonstrates creating an OSSClient instance with an OSS endpoint. For alternative configurations, such as using a custom domain or authenticating with credentials from Security Token Service (STS), see Configure a client (Go SDK V1).
-
By default, an Alibaba Cloud account has permissions for data replication. If you want to perform data replication operations as a Resource Access Management (RAM) user or using temporary access credentials provided by STS, you must have the required permissions.
-
To enable data replication, you must have the
oss:PutBucketReplicationpermission. -
To enable or disable replication time control (RTC), you must have the
oss:PutBucketRtcpermission. -
To query data replication rules, you must have the
oss:GetBucketReplicationpermission. -
To query available destination regions, you must have the
oss:GetBucketReplicationLocationpermission. -
To view the data replication progress, you must have the
oss:GetBucketReplicationProgresspermission. -
To disable data replication, you must have the
oss:DeleteBucketReplicationpermission.
-
Examples
References
-
For more information about the API operation for enabling data replication, see PutBucketReplication.
-
For more information about the API operation for enabling or disabling replication time control (RTC) for an existing cross-region replication rule, see PutBucketRTC.
-
For more information about the API operation for querying data replication rules, see GetBucketReplication.
-
For more information about the API operation for querying available destination regions, see GetBucketReplicationLocation.
-
For more information about the API operation for querying data replication progress, see GetBucketReplicationProgress.
-
For more information about the API operation for disabling data replication, see DeleteBucketReplication.