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

GET Bucket replication

Description

Returns the replication configuration information set on the bucket. For information about replication configuration, go to Adding Replication Configuration to a Bucket in the Amazon Simple Storage Service Developer Guide.

This operation requires permission for the s3:GetReplicationConfiguration action. For more information about permissions, go to Using Bucket Policies and User Policies in the Amazon Simple Storage Service Developer Guide.

Requests

Syntax

Copy
GET /?replication HTTP/1.1 Host: bucketname.s3.amazonaws.com Date: date Authorization: authorization string (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.

Name Description
ReplicationConfiguration

Container for replication rules. You can add as many as 1,000 rules. Total replication configuration size can be up to 2 MB.

Type: Container

Children: Rule

Ancestor: None

Role

Amazon Resource Name (ARN) of an IAM role for Amazon S3 to assume when replicating the objects.

Type: String

Ancestor: Rule

Rule

Container for information about a particular replication rule. Replication configuration must have at least one rule and can contain up to 1,000 rules.

Type: Container

Ancestor:ReplicationConfiguration

ID

Unique identifier for the rule. The value cannot be longer than 255 characters.

Type: String

Ancestor: Rule

Status

The rule is ignored if status is not Enabled.

Type: String

Ancestor: Rule

Valid values: Enabled, Disabled.

Prefix

Object key name prefix identifying one or more objects to which the rule applies. Maximum prefix length can be up to 1,024 characters. Overlapping prefixes are not supported.

Type: String

Ancestor: Rule

Destination

Container for destination information.

Type: Container

Ancestor: Rule

Bucket

Bucket name for storing replicas of objects identified by the rule.

Type: String

Ancestor: Destination

StorageClass

Storage class to use for the replicated objects. If you did not set the storage class when you configured the cross-region replication (PUT Bucket replication), this field is not returned.

Type: String

Ancestor: Destination

Special Errors

Error Code Description HTTP Status Code SOAP Fault Code Prefix
NoSuchReplicationConfiguration The replication configuration does not exist. 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 example GET request retrieves replication configuration information set for the examplebucket bucket.

Copy
GET /?replication HTTP/1.1 Host: examplebucket.s3.amazonaws.com x-amz-date: Tue, 10 Feb 2015 00:17:21 GMT Authorization: signatureValue

The following sample response shows that replication is enabled on the bucket, and the empty prefix indicates that Amazon S3 will replicate all objects created in the examplebucket bucket. The Destination element shows the target bucket where Amazon S3 creates the object replicas and the storage class (STANDARD_IA) that Amazon S3 will use when creating replicas.

Amazon S3 will assume the specified role to replicate objects on behalf of the bucket owner, which is the AWS account that created the bucket.

Copy
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 xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Rule> <ID>rule1</ID> <Status>Enabled</Status> <Prefix></Prefix> <Destination> <Bucket>arn:aws:s3:::exampletargetbucket</Bucket> <StorageClass>STANDARD_IA</StorageClass> </Destination> </Rule> <Role>arn:aws:iam::35667example:role/CrossRegionReplicationRoleForS3</Role> </ReplicationConfiguration>