@Override
    public PutBucketReplicationResult putBucketReplication(PutBucketReplicationRequest request) {
        request = beforeClientExecution(request);
        return executePutBucketReplication(request);
    }
<note>
<p>
This action creates an Amazon S3 on Outposts bucket's replication configuration. To create an S3 bucket's
replication configuration, see <a
href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html">PutBucketReplication</a> in
the <i>Amazon S3 API Reference</i>.
</p>
</note>
<p>
Creates a replication configuration or replaces an existing one. For information about S3 replication on Outposts
configuration, see <a
href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsReplication.html">Replicating objects for
S3 on Outposts</a> in the <i>Amazon S3 User Guide</i>.
</p>
<note>
<p>
It can take a while to propagate <code>PUT</code> or <code>DELETE</code> requests for a replication configuration
to all S3 on Outposts systems. Therefore, the replication configuration that's returned by a <code>GET</code>
request soon after a <code>PUT</code> or <code>DELETE</code> 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.
</p>
</note>
<p>
Specify the replication configuration in the request body. In the replication configuration, you provide the
following information:
</p>
<ul>
<li>
<p>
The name of the destination bucket or buckets where you want S3 on Outposts to replicate objects
</p>
</li>
<li>
<p>
The Identity and Access Management (IAM) role that S3 on Outposts can assume to replicate objects on your behalf
</p>
</li>
<li>
<p>
Other relevant information, such as replication rules
</p>
</li>
</ul>
<p>
A replication configuration must include at least one rule and can contain a maximum of 100. Each rule identifies
a subset of objects to replicate by filtering the objects in the source Outposts bucket. To choose additional
subsets of objects to replicate, add a rule for each subset.
</p>
<p>
To specify a subset of the objects in the source Outposts bucket to apply a replication rule to, add the
<code>Filter</code> element as a child of the <code>Rule</code> element. You can filter objects based on an
object key prefix, one or more object tags, or both. When you add the <code>Filter</code> element in the
configuration, you must also add the following elements: <code>DeleteMarkerReplication</code>,
<code>Status</code>, and <code>Priority</code>.
</p>
<p>
Using <code>PutBucketReplication</code> on Outposts requires that both the source and destination buckets must
have versioning enabled. For information about enabling versioning on a bucket, see <a
href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsManagingVersioning.html">Managing S3
Versioning for your S3 on Outposts bucket</a>.
</p>
<p>
For information about S3 on Outposts replication failure reasons, see <a href=
"https://docs.aws.amazon.com/AmazonS3/latest/userguide/outposts-replication-eventbridge.html#outposts-replication-failure-codes"
>Replication failure reasons</a> in the <i>Amazon S3 User Guide</i>.
</p>
<p>
<b>Handling Replication of Encrypted Objects</b>
</p>
<p>
Outposts buckets are encrypted at all times. All the objects in the source Outposts bucket are encrypted and can
be replicated. Also, all the replicas in the destination Outposts bucket are encrypted with the same encryption
key as the objects in the source Outposts bucket.
</p>
<p>
<b>Permissions</b>
</p>
<p>
To create a <code>PutBucketReplication</code> request, you must have
<code>s3-outposts:PutReplicationConfiguration</code> permissions for the bucket. The Outposts bucket owner has
this permission by default and can grant it to others. For more information about permissions, see <a
href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsIAM.html">Setting up IAM with S3 on
Outposts</a> and <a
href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsBucketPolicy.html">Managing access to S3 on
Outposts buckets</a>.
</p>
<note>
<p>
To perform this operation, the user or role must also have the <code>iam:CreateRole</code> and
<code>iam:PassRole</code> permissions. For more information, see <a
href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html">Granting a user permissions to
pass a role to an Amazon Web Services service</a>.
</p>
</note>
<p>
All Amazon S3 on Outposts REST API requests for this action require an additional parameter of
<code>x-amz-outpost-id</code> to be passed with the request. In addition, you must use an S3 on Outposts endpoint
hostname prefix instead of <code>s3-control</code>. For an example of the request syntax for Amazon S3 on
Outposts that uses the S3 on Outposts endpoint hostname prefix and the <code>x-amz-outpost-id</code> derived by
using the access point ARN, see the <a href=
"https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketReplication.html#API_control_PutBucketReplication_Examples"
>Examples</a> section.
</p>
<p>
The following operations are related to <code>PutBucketReplication</code>:
</p>
<ul>
<li>
<p>
<a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketReplication.html">
GetBucketReplication</a>
</p>
</li>
<li>
<p>
<a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketReplication.html">
DeleteBucketReplication</a>
</p>
</li>
</ul>

@param putBucketReplicationRequest
@return Result of the PutBucketReplication operation returned by the service.
@sample AWSS3Control.PutBucketReplication
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutBucketReplication" target="_top">AWS
     API Documentation</a>
aws-java-sdk-s3control/src/main/java/com/amazonaws/services/s3control/AWSS3ControlClient.java