Amazon Simple Storage Service
API Reference (API Version 2006-03-01)

GetBucketReplication

Returns the replication configuration of a bucket.

Note

It can take a while to propagate the put or delete a replication configuration to all Amazon S3 systems. Therefore, a get request soon after put or delete can return a wrong result.

For information about replication configuration, see Replication.

This operation requires permissions for the s3:GetReplicationConfiguration action. For more information about permissions, see Using Bucket Policies and User Policies.

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.

GetBucketReplication has the following special error:

  • Error code: NoSuchReplicationConfiguration

    • Description: There is no replication configuration with that name.

    • HTTP Status Code: 404 Not Found

    • SOAP Fault Code Prefix: Client

The following operations are related to GetBucketReplication:

Request Syntax

GET /?replication HTTP/1.1 Host: Bucket.s3.amazonaws.com

URI Request Parameters

The request requires the following URI parameters.

Bucket

The bucket name for which to get the replication information.

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200 <?xml version="1.0" encoding="UTF-8"?> <ReplicationConfiguration> <Role>string</Role> <Rule> <DeleteMarkerReplication> <Status>string</Status> </DeleteMarkerReplication> <Destination> <AccessControlTranslation> <Owner>string</Owner> </AccessControlTranslation> <Account>string</Account> <Bucket>string</Bucket> <EncryptionConfiguration> <ReplicaKmsKeyID>string</ReplicaKmsKeyID> </EncryptionConfiguration> <StorageClass>string</StorageClass> </Destination> <Filter> <And> <Prefix>string</Prefix> <Tag> <Key>string</Key> <Value>string</Value> </Tag> ... </And> <Prefix>string</Prefix> <Tag> <Key>string</Key> <Value>string</Value> </Tag> </Filter> <ID>string</ID> <Prefix>string</Prefix> <Priority>integer</Priority> <SourceSelectionCriteria> <SseKmsEncryptedObjects> <Status>string</Status> </SseKmsEncryptedObjects> </SourceSelectionCriteria> <Status>string</Status> </Rule> ... </ReplicationConfiguration>

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in XML format by the service.

ReplicationConfiguration

Root level tag for the ReplicationConfiguration parameters.

Required: Yes

Role

The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that Amazon S3 assumes when replicating objects. For more information, see How to Set Up Replication in the Amazon Simple Storage Service Developer Guide.

Type: String

Rule

A container for one or more replication rules. A replication configuration must have at least one rule and can contain a maximum of 1,000 rules.

Type: Array of ReplicationRule data types

Examples

Sample Request: 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

Sample Response

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>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: