<a id="cli-aws-s3control-get-bucket-replication"></a>

# get-bucket-replication

## Description

#### NOTE
This operation gets an Amazon S3 on Outposts bucket’s replication configuration. To get an S3 bucket’s replication configuration, see [GetBucketReplication](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html) in the *Amazon S3 API Reference* .

Returns the replication configuration of an S3 on Outposts bucket. For more information about S3 on Outposts, see [Using Amazon S3 on Outposts](https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the *Amazon S3 User Guide* . For information about S3 replication on Outposts configuration, see [Replicating objects for S3 on Outposts](https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsReplication.html) in the *Amazon S3 User Guide* .

#### NOTE
It can take a while to propagate `PUT` or `DELETE` requests for a replication configuration to all S3 on Outposts systems. Therefore, the replication configuration that’s returned by a `GET` request soon after a `PUT` or `DELETE` request might return a more recent result than what’s on the Outpost. If an Outpost is offline, the delay in updating the replication configuration on that Outpost can be significant.

This action requires permissions for the `s3-outposts:GetReplicationConfiguration` action. The Outposts bucket owner has this permission by default and can grant it to others. For more information about permissions, see [Setting up IAM with S3 on Outposts](https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsIAM.html) and [Managing access to S3 on Outposts bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsBucketPolicy.html) in the *Amazon S3 User Guide* .

All Amazon S3 on Outposts REST API requests for this action require an additional parameter of `x-amz-outpost-id` to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of `s3-control` . For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the `x-amz-outpost-id` derived by using the access point ARN, see the [Examples](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketReplication.html#API_control_GetBucketReplication_Examples) section.

If you include the `Filter` element in a replication configuration, you must also include the `DeleteMarkerReplication` , `Status` , and `Priority` elements. The response also returns those elements.

For information about S3 on Outposts replication failure reasons, see [Replication failure reasons](https://docs.aws.amazon.com/AmazonS3/latest/userguide/outposts-replication-eventbridge.html#outposts-replication-failure-codes) in the *Amazon S3 User Guide* .

The following operations are related to `GetBucketReplication` :

* [PutBucketReplication](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketReplication.html)
* [DeleteBucketReplication](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketReplication.html)

See also: [AWS API Documentation](https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetBucketReplication)

## Synopsis

```
  get-bucket-replication
--account-id <value>
--bucket <value>
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
[--cli-error-format <value>]
```

## Options

`--account-id` (string) [required]

> The Amazon Web Services account ID of the Outposts bucket.

> Constraints:

> * max: `64`
> * pattern: `^\d{12}$`

`--bucket` (string) [required]

> Specifies the bucket to get the replication information for.

> For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.

> For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format `arn:aws:s3-outposts:<Region>:<account-id>:outpost/<outpost-id>/bucket/<my-bucket-name>` . For example, to access the bucket `reports` through Outpost `my-outpost` owned by account `123456789012` in Region `us-west-2` , use the URL encoding of `arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports` . The value must be URL encoded.

> Constraints:

> * min: `3`
> * max: `255`

`--cli-input-json` | `--cli-input-yaml` (string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by `--generate-cli-skeleton`. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with `--cli-input-yaml`.

`--generate-cli-skeleton` (string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value `input`, prints a sample input JSON that can be used as an argument for `--cli-input-json`. Similarly, if provided `yaml-input` it will print a sample input YAML that can be used with `--cli-input-yaml`. If provided with the value `output`, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.

## Global Options

`--debug` (boolean)

Turn on debug logging.

`--endpoint-url` (string)

Override command’s default URL with the given URL.

`--no-verify-ssl` (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

`--no-paginate` (boolean)

Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.

`--output` (string)

The formatting style for command output.

* json
* text
* table
* yaml
* yaml-stream
* off

`--query` (string)

A JMESPath query to use in filtering the response data.

`--profile` (string)

Use a specific profile from your credential file.

`--region` (string)

The region to use. Overrides config/env settings.

`--version` (string)

Display the version of this tool.

`--color` (string)

Turn on/off color output.

* on
* off
* auto

`--no-sign-request` (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

`--ca-bundle` (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

`--cli-read-timeout` (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

`--cli-connect-timeout` (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

`--cli-binary-format` (string)

The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob `fileb://` will always be treated as binary and use the file contents directly regardless of the `cli-binary-format` setting. When using `file://` the file contents will need to properly formatted for the configured `cli-binary-format`.

* base64
* raw-in-base64-out

`--no-cli-pager` (boolean)

Disable cli pager for output.

`--cli-auto-prompt` (boolean)

Automatically prompt for CLI input parameters.

`--no-cli-auto-prompt` (boolean)

Disable automatically prompt for CLI input parameters.

`--cli-error-format` (string)

The formatting style for error output. By default, errors are displayed in enhanced format.

* legacy
* json
* yaml
* text
* table
* enhanced

## Output

ReplicationConfiguration -> (structure)

> A container for one or more replication rules. A replication configuration must have at least one rule and you can add up to 100 rules. The maximum size of a replication configuration is 128 KB.

> Role -> (string) [required]

> > The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that S3 on Outposts assumes when replicating objects. For information about S3 replication on Outposts configuration, see [Setting up replication](https://docs.aws.amazon.com/AmazonS3/latest/userguide/outposts-replication-how-setup.html) in the *Amazon S3 User Guide* .

> Rules -> (list) [required]

> > A container for one or more replication rules. A replication configuration must have at least one rule and can contain an array of 100 rules at the most.

> > (structure)

> > > Specifies which S3 on Outposts objects to replicate and where to store the replicas.

> > > ID -> (string)

> > > > A unique identifier for the rule. The maximum value is 255 characters.

> > > Priority -> (integer)

> > > > The priority indicates which rule has precedence whenever two or more replication rules conflict. S3 on Outposts attempts to replicate objects according to all replication rules. However, if there are two or more rules with the same destination Outposts bucket, then objects will be replicated according to the rule with the highest priority. The higher the number, the higher the priority.

> > > > For more information, see [Creating replication rules on Outposts](https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication-between-outposts.html) in the *Amazon S3 User Guide* .

> > > Prefix -> (string)

> > > > An object key name prefix that identifies the object or objects to which the rule applies. The maximum prefix length is 1,024 characters. To include all objects in an Outposts bucket, specify an empty string.

> > > > #### WARNING
> > > > When you’re using XML requests, you must replace special characters (such as carriage returns) in object keys with their equivalent XML entity codes. For more information, see [XML-related object key constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints) in the *Amazon S3 User Guide* .

> > > Filter -> (structure)

> > > > A filter that identifies the subset of objects to which the replication rule applies. A `Filter` element must specify exactly one `Prefix` , `Tag` , or `And` child element.

> > > > Prefix -> (string)

> > > > > An object key name prefix that identifies the subset of objects that the rule applies to.

> > > > > #### WARNING
> > > > > When you’re using XML requests, you must replace special characters (such as carriage returns) in object keys with their equivalent XML entity codes. For more information, see [XML-related object key constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints) in the *Amazon S3 User Guide* .

> > > > Tag -> (structure)

> > > > > A container for a key-value name pair.

> > > > > Key -> (string) [required]

> > > > > > Key of the tag

> > > > > > Constraints:

> > > > > > * min: `1`
> > > > > > * max: `128`
> > > > > > * pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`

> > > > > Value -> (string) [required]

> > > > > > Value of the tag

> > > > > > Constraints:

> > > > > > * min: `0`
> > > > > > * max: `256`
> > > > > > * pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`

> > > > And -> (structure)

> > > > > A container for specifying rule filters. The filters determine the subset of objects that the rule applies to. This element is required only if you specify more than one filter. For example:

> > > > > * If you specify both a `Prefix` and a `Tag` filter, wrap these filters in an `And` element.
> > > > > * If you specify a filter based on multiple tags, wrap the `Tag` elements in an `And` element.

> > > > > Prefix -> (string)

> > > > > > An object key name prefix that identifies the subset of objects that the rule applies to.

> > > > > Tags -> (list)

> > > > > > An array of tags that contain key and value pairs.

> > > > > > (structure)

> > > > > > > A container for a key-value name pair.

> > > > > > > Key -> (string) [required]

> > > > > > > > Key of the tag

> > > > > > > > Constraints:

> > > > > > > > * min: `1`
> > > > > > > > * max: `128`
> > > > > > > > * pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`

> > > > > > > Value -> (string) [required]

> > > > > > > > Value of the tag

> > > > > > > > Constraints:

> > > > > > > > * min: `0`
> > > > > > > > * max: `256`
> > > > > > > > * pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`

> > > Status -> (string) [required]

> > > > Specifies whether the rule is enabled.

> > > > Possible values:

> > > > * `Enabled`
> > > > * `Disabled`

> > > SourceSelectionCriteria -> (structure)

> > > > A container that describes additional filters for identifying the source Outposts objects that you want to replicate. You can choose to enable or disable the replication of these objects.

> > > > SseKmsEncryptedObjects -> (structure)

> > > > > A filter that you can use to select Amazon S3 objects that are encrypted with server-side encryption by using Key Management Service (KMS) keys. If you include `SourceSelectionCriteria` in the replication configuration, this element is required.

> > > > > #### NOTE
> > > > > This is not supported by Amazon S3 on Outposts buckets.

> > > > > Status -> (string) [required]

> > > > > > Specifies whether Amazon S3 replicates objects that are created with server-side encryption by using an KMS key stored in Key Management Service.

> > > > > > Possible values:

> > > > > > * `Enabled`
> > > > > > * `Disabled`

> > > > ReplicaModifications -> (structure)

> > > > > A filter that you can use to specify whether replica modification sync is enabled. S3 on Outposts replica modification sync can help you keep object metadata synchronized between replicas and source objects. By default, S3 on Outposts replicates metadata from the source objects to the replicas only. When replica modification sync is enabled, S3 on Outposts replicates metadata changes made to the replica copies back to the source object, making the replication bidirectional.

> > > > > To replicate object metadata modifications on replicas, you can specify this element and set the `Status` of this element to `Enabled` .

> > > > > #### NOTE
> > > > > You must enable replica modification sync on the source and destination buckets to replicate replica metadata changes between the source and the replicas.

> > > > > Status -> (string) [required]

> > > > > > Specifies whether S3 on Outposts replicates modifications to object metadata on replicas.

> > > > > > Possible values:

> > > > > > * `Enabled`
> > > > > > * `Disabled`

> > > ExistingObjectReplication -> (structure)

> > > > An optional configuration to replicate existing source bucket objects.

> > > > #### NOTE
> > > > This is not supported by Amazon S3 on Outposts buckets.

> > > > Status -> (string) [required]

> > > > > Specifies whether Amazon S3 replicates existing source bucket objects.

> > > > > Possible values:

> > > > > * `Enabled`
> > > > > * `Disabled`

> > > Destination -> (structure) [required]

> > > > A container for information about the replication destination and its configurations.

> > > > Account -> (string)

> > > > > The destination bucket owner’s account ID.

> > > > > Constraints:

> > > > > * max: `64`
> > > > > * pattern: `^\d{12}$`

> > > > Bucket -> (string) [required]

> > > > > The Amazon Resource Name (ARN) of the access point for the destination bucket where you want S3 on Outposts to store the replication results.

> > > > ReplicationTime -> (structure)

> > > > > A container that specifies S3 Replication Time Control (S3 RTC) settings, including whether S3 RTC is enabled and the time when all objects and operations on objects must be replicated. Must be specified together with a `Metrics` block.

> > > > > #### NOTE
> > > > > This is not supported by Amazon S3 on Outposts buckets.

> > > > > Status -> (string) [required]

> > > > > > Specifies whether S3 Replication Time Control (S3 RTC) is enabled.

> > > > > > Possible values:

> > > > > > * `Enabled`
> > > > > > * `Disabled`

> > > > > Time -> (structure) [required]

> > > > > > A container that specifies the time by which replication should be complete for all objects and operations on objects.

> > > > > > Minutes -> (integer)

> > > > > > > Contains an integer that specifies the time period in minutes.

> > > > > > > Valid value: 15

> > > > AccessControlTranslation -> (structure)

> > > > > Specify this property only in a cross-account scenario (where the source and destination bucket owners are not the same), and you want to change replica ownership to the Amazon Web Services account that owns the destination bucket. If this property is not specified in the replication configuration, the replicas are owned by same Amazon Web Services account that owns the source object.

> > > > > #### NOTE
> > > > > This is not supported by Amazon S3 on Outposts buckets.

> > > > > Owner -> (string) [required]

> > > > > > Specifies the replica ownership.

> > > > > > Possible values:

> > > > > > * `Destination`

> > > > EncryptionConfiguration -> (structure)

> > > > > A container that provides information about encryption. If `SourceSelectionCriteria` is specified, you must specify this element.

> > > > > #### NOTE
> > > > > This is not supported by Amazon S3 on Outposts buckets.

> > > > > ReplicaKmsKeyID -> (string)

> > > > > > Specifies the ID of the customer managed KMS key that’s stored in Key Management Service (KMS) for the destination bucket. This ID is either the Amazon Resource Name (ARN) for the KMS key or the alias ARN for the KMS key. Amazon S3 uses this KMS key to encrypt replica objects. Amazon S3 supports only symmetric encryption KMS keys. For more information, see [Symmetric encryption KMS keys](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks) in the *Amazon Web Services Key Management Service Developer Guide* .

> > > > Metrics -> (structure)

> > > > > A container that specifies replication metrics-related settings.

> > > > > Status -> (string) [required]

> > > > > > Specifies whether replication metrics are enabled.

> > > > > > Possible values:

> > > > > > * `Enabled`
> > > > > > * `Disabled`

> > > > > EventThreshold -> (structure)

> > > > > > A container that specifies the time threshold for emitting the `s3:Replication:OperationMissedThreshold` event.

> > > > > > #### NOTE
> > > > > > This is not supported by Amazon S3 on Outposts buckets.

> > > > > > Minutes -> (integer)

> > > > > > > Contains an integer that specifies the time period in minutes.

> > > > > > > Valid value: 15

> > > > StorageClass -> (string)

> > > > > The storage class to use when replicating objects. All objects stored on S3 on Outposts are stored in the `OUTPOSTS` storage class. S3 on Outposts uses the `OUTPOSTS` storage class to create the object replicas.

> > > > > #### NOTE
> > > > > Values other than `OUTPOSTS` aren’t supported by Amazon S3 on Outposts.

> > > > > Possible values:

> > > > > * `STANDARD`
> > > > > * `REDUCED_REDUNDANCY`
> > > > > * `STANDARD_IA`
> > > > > * `ONEZONE_IA`
> > > > > * `INTELLIGENT_TIERING`
> > > > > * `GLACIER`
> > > > > * `DEEP_ARCHIVE`
> > > > > * `OUTPOSTS`
> > > > > * `GLACIER_IR`

> > > DeleteMarkerReplication -> (structure)

> > > > Specifies whether S3 on Outposts replicates delete markers. If you specify a `Filter` element in your replication configuration, you must also include a `DeleteMarkerReplication` element. If your `Filter` includes a `Tag` element, the `DeleteMarkerReplication` element’s `Status` child element must be set to `Disabled` , because S3 on Outposts doesn’t support replicating delete markers for tag-based rules.

> > > > For more information about delete marker replication, see [How delete operations affect replication](https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsReplication.html#outposts-replication-what-is-replicated) in the *Amazon S3 User Guide* .

> > > > Status -> (string) [required]

> > > > > Indicates whether to replicate delete markers.

> > > > > Possible values:

> > > > > * `Enabled`
> > > > > * `Disabled`

> > > Bucket -> (string) [required]

> > > > The Amazon Resource Name (ARN) of the access point for the source Outposts bucket that you want S3 on Outposts to replicate the objects from.
