GET Bucket replication
Description
Returns a bucket's replication configuration.
Note
It can take a while for PUT Bucket replication and DELETE Bucket
replication requests to fully propagate. If you submit a GET Bucket
replication request soon after submitting either of those requests, might not
return the latest replication configuration.
For information about replication configuration, see Cross-Region Replication (CRR) in the Amazon Simple Storage Service Developer Guide.
This operation requires permissions for the s3:GetReplicationConfiguration
action. For more information about permissions, see Using Bucket
Policies and User Policies in the Amazon Simple Storage Service Developer Guide.
Requests
Syntax
GET /?replication HTTP/1.1 Host:bucketname.s3.amazonaws.com Date:dateAuthorization:authorization string
For more information about authorization, see Authenticating Requests (AWS Signature Version 4).
Request Parameters
This implementation of the operation does not use request parameters.
Request Headers
This implementation of the operation uses only request headers that are common to all operations. For more information, see Common Request Headers.
Request Elements
This implementation of the operation does not use request elements.
Responses
Response Headers
This implementation of the operation uses only response headers that are common to most responses. For more information, see Common Response Headers.
Response Elements
This implementation of GET returns the following response
elements.
| Element | Description |
|---|---|
ReplicationConfiguration |
The container for replication rules. Type: Container Children: Ancestor: None |
Rule
|
The container for information about a particular replication rule. Type: Container Ancestor: |
Role
|
The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) role that Amazon S3 assumes when replicating objects. Type: String Ancestor: |
ID
|
The unique identifier for the rule. Type: String Ancestor: |
Status
|
Whether a rule is enabled. If Type: String Ancestor: Valid values: |
Prefix
|
The object key name prefix that identifies the objects that the rule applies to. Note If the replication configuration uses the Type: String Ancestor: |
Destination
|
A container for information about the destination. Type: Container Ancestor: |
Account |
The account ID of the owner of the destination bucket. In a cross-account scenario, if you tell Amazon S3 to change replica ownership to the AWS account that owns the destination bucket, this is the account ID of the owner of the destination bucket. For more information, see Cross-Region Replication Additional Configuration: Change Replica Owner in the Amazon Simple Storage Service Developer Guide. If the owner override option is not set in a replication configuration, the response does include this element. Type: String Ancestor: |
Bucket
|
The name of the bucket where Amazon S3 stores replicas of objects identified by the rule. Type: String Ancestor: |
StorageClass
|
The storage class for replicated objects. This field is returned only if you set the storage class when you configured cross-region replication (with PUT Bucket replication). Type: String Ancestor: Valid values: |
AccessControlTranslation
|
If you set the owner override option in the replication configuration, Amazon S3 returns this element. It identifies the owner of the replicas. If this element isn't present, replicas are owned by the same AWS account that owns the source object. Type: String Ancestor: |
Owner
|
Identifies the owner of the replicas. Amazon S3 returns this element only if you
configured owner override option, in a cross-account scenario.
Type: String Ancestor: |
Rule Filter Response Elements
A replication configuration rule can specify a filter to identify a subset of source objects to apply the rule to. The response can return the following additional elements, which are related to filtering.
| Element | Description |
|---|---|
Filter
|
The container that describes the filters used to identify the source objects that you want to replicate. Ancestor: |
And
|
The container for the Ancestor: |
Prefix
|
The object key prefix that identifies one or more objects that the rule applies to. Note The earlier version of replication configuration (V1) supported only the key
prefix as a rule filter. In V1, the response returns the Type: String Ancestor: |
Tag
|
A container that provides a tag key and value. Ancestor: |
Key
|
A tag key. Type: String Ancestor: |
Value
|
A tag value. Type: String Ancestor: |
If you include the Filter element in a replication configuration, you must
also include the
DeleteMarkerReplication
and Priority elements. The
response also returns those elements.
| Element | Description |
|---|---|
DeleteMarkerReplication
|
A container that describes whether Amazon S3 replicates the delete markers.
Ancestor: |
Status
|
Indicates whether to replicate delete markers.
Type: String Ancestor: |
Priority
|
If you specify multiple rules with overlapping filters, identifies the rule
priority. For example, if two rules apply to the same object based on the
Filter specified, then the rule with higher priority supersedes.
The higher the numerical value of this element, the higher the rule priority. For
more information, see Backward Compatibility in the Amazon S3 Developer
Guide.
Type: Integer Ancestor:
|
Encryption Response Elements
If a replication configuration specifies replicating objects created with server-side encryption using an AWS KMS-managed key, the response returns the following additional elements. For more information, see CRR: Replicating Objects Created with SSE Using AWS KMS-Managed Encryption Keys in the Amazon Simple Storage Service Developer Guide.
| Element | Description |
|---|---|
SourceSelectionCriteria
|
A container that describes additional filters that identify the source objects that you want to replicate. Type: String Ancestor: |
SseKmsEncryptedObjects
|
A container for the Type: String Ancestor: |
Status
|
A flag that tells Amazon S3 whether to replicate objects created with server-side encryption using an AWS KMS-managed key. Type: String Ancestor: |
EncryptionConfiguration
|
A container that provides information about encryption. Type: String Ancestor: |
ReplicaKmsKeyID
|
The AWS KMS Key ID—the Key Amazon Resource Name (ARN) or Alias ARN—of the destination bucket. Amazon S3 uses this key to encrypt replicas. Type: String Ancestor: |
Special Errors
| Error Code | Description | HTTP Status Code | SOAP Fault Code Prefix |
|---|---|---|---|
NoSuchReplicationConfiguration |
There is no replication configuration with that name. | 404 Not Found | Client |
For general information about Amazon S3 errors and a list of error codes, see Error Responses.
Examples
Example 1: Retrieve Replication Configuration Information
The following GET request retrieves information about the replication
configuration set for the examplebucket bucket:
GET /?replication HTTP/1.1 Host: examplebucket.s3.amazonaws.com Date: Tue, 10 Feb 2015 00:17:21 GMT Authorization:authorization string
The following response shows that replication is enabled on the bucket. The empty
prefix
indicates that Amazon S3 will replicate all objects that are created in the
examplebucket bucket. The Destination element identifies the
target bucket where Amazon S3 creates the object replicas, and the storage class (STANDARD_IA)
that Amazon S3 uses when creating replicas.
Amazon S3 assumes the specified IAM role to replicate objects on behalf of the bucket owner, which is the AWS account that created the bucket.
HTTP/1.1 200 OK x-amz-id-2: ITnGT1y4RyTmXa3rPi4hklTXouTf0hccUjo0iCPjz6FnfIutBj3M7fPGlWO2SEWp x-amz-request-id: 51991C342example Date: Tue, 10 Feb 2015 00:17:23 GMT Server: AmazonS3 Content-Length:contentlength<?xml version="1.0" encoding="UTF-8"?> <ReplicationConfiguration> <Role>arn:aws:iam::35667example:role/CrossRegionReplicationRoleForS3</Role> <Rule> <ID>rule1</ID> <Status>Enabled</Status> <Priority>1</Priority> <DeleteMarkerReplication> <Status>Disabled</Status> </DeleteMarkerReplication> <Filter> <And> <Prefix>TaxDocs</Prefix> <Tag> <Key>key1</Key> <Value>value1</Value> </Tag> <Tag> <Key>key1</Key> <Value>value1</Value> </Tag> </And> </Filter> <Destination> <Bucket>arn:aws:s3:::exampletargetbucket</Bucket> </Destination> </Rule> </ReplicationConfiguration>


