Skip to content

put_table_bucket_replication

put_table_bucket_replication(
    table_bucket_arn: TableBucketARN,
    configuration: TableBucketReplicationConfiguration,
    *,
    config_overrides: Optional[S3TablesClientConfig] = None,
    version_token: Optional[VersionToken] = None,
) -> PutTableBucketReplicationResponse

Creates or updates the replication configuration for a table bucket. This operation defines how tables in the source bucket are replicated to destination buckets. Replication helps ensure data availability and disaster recovery across regions or accounts.

Permissions
  • You must have the s3tables:PutTableBucketReplication permission to use this operation. The IAM role specified in the configuration must have permissions to read from the source bucket and write permissions to all destination buckets.

  • You must also have the following permissions:

    • s3tables:GetTable permission on the source table.

    • s3tables:ListTables permission on the bucket containing the table.

    • s3tables:CreateTable permission for the destination.

    • s3tables:CreateNamespace permission for the destination.

    • s3tables:GetTableMaintenanceConfig permission for the source bucket.

    • s3tables:PutTableMaintenanceConfig permission for the destination bucket.

  • You must have iam:PassRole permission with condition allowing roles to be passed to replication.s3tables.amazonaws.com.

Parameters:

  • table_bucket_arn (TableBucketARN) –

    The Amazon Resource Name (ARN) of the source table bucket.

  • version_token (Optional[VersionToken], default: None ) –

    A version token from a previous GetTableBucketReplication call. Use this token to ensure you're updating the expected version of the configuration.

  • configuration (TableBucketReplicationConfiguration) –

    The replication configuration to apply, including the IAM role and replication rules.

Raises:

Source code in docs_src/capo_s3tables/_services/s3_tables.py
def put_table_bucket_replication(
    self,
    table_bucket_arn: "capo_s3tables.types.table_bucket_arn.TableBucketARN",
    configuration: "capo_s3tables.types.table_bucket_replication_configuration.TableBucketReplicationConfiguration",
    *,
    config_overrides: Optional[S3TablesClientConfig] = None,
    version_token: Optional[
        "capo_s3tables.types.version_token.VersionToken"
    ] = None,
) -> "capo_s3tables.types.put_table_bucket_replication_response.PutTableBucketReplicationResponse":
    """<p>Creates or updates the replication configuration for a table bucket. This operation defines how tables in the source bucket are replicated to destination buckets. Replication helps ensure data availability and disaster recovery across regions or accounts.</p> <dl> <dt>Permissions</dt> <dd> <ul> <li> <p>You must have the <code>s3tables:PutTableBucketReplication</code> permission to use this operation. The IAM role specified in the configuration must have permissions to read from the source bucket and write permissions to all destination buckets.</p> </li> <li> <p>You must also have the following permissions:</p> <ul> <li> <p> <code>s3tables:GetTable</code> permission on the source table.</p> </li> <li> <p> <code>s3tables:ListTables</code> permission on the bucket containing the table.</p> </li> <li> <p> <code>s3tables:CreateTable</code> permission for the destination.</p> </li> <li> <p> <code>s3tables:CreateNamespace</code> permission for the destination.</p> </li> <li> <p> <code>s3tables:GetTableMaintenanceConfig</code> permission for the source bucket.</p> </li> <li> <p> <code>s3tables:PutTableMaintenanceConfig</code> permission for the destination bucket.</p> </li> </ul> </li> <li> <p>You must have <code>iam:PassRole</code> permission with condition allowing roles to be passed to <code>replication.s3tables.amazonaws.com</code>.</p> </li> </ul> </dd> </dl>

    Args:
        table_bucket_arn: <p>The Amazon Resource Name (ARN) of the source table bucket.</p>
        version_token: <p>A version token from a previous GetTableBucketReplication call. Use this token to ensure you're updating the expected version of the configuration.</p>
        configuration: <p>The replication configuration to apply, including the IAM role and replication rules.</p>

    Raises:
        capo_s3tables.errors.access_denied_exception.AccessDeniedException: <p>The action cannot be performed because you do not have the required permission.</p>
        capo_s3tables.errors.bad_request_exception.BadRequestException: <p>The request is invalid or malformed.</p>
        capo_s3tables.errors.conflict_exception.ConflictException: <p>The request failed because there is a conflict with a previous write. You can retry the request.</p>
        capo_s3tables.errors.forbidden_exception.ForbiddenException: <p>The caller isn't authorized to make the request.</p>
        capo_s3tables.errors.internal_server_error_exception.InternalServerErrorException: <p>The request failed due to an internal server error.</p>
        capo_s3tables.errors.not_found_exception.NotFoundException: <p>The request was rejected because the specified resource could not be found.</p>
        capo_s3tables.errors.too_many_requests_exception.TooManyRequestsException: <p>The limit on the number of requests per second was exceeded.</p>
        capo_s3tables.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_s3tables.types.put_table_bucket_replication_request.PutTableBucketReplicationRequest]",
    ) -> OperationResponse[
        "capo_s3tables.types.put_table_bucket_replication_response.PutTableBucketReplicationResponse"
    ]:
        import capo_s3tables._operations.s3_table_buckets.put_table_bucket_replication

        output, http_response = (
            capo_s3tables._operations.s3_table_buckets.put_table_bucket_replication.put_table_bucket_replication(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutTableBucketReplication")
    )
    input_: capo_s3tables.types.put_table_bucket_replication_request.PutTableBucketReplicationRequest = {
        "table_bucket_arn": table_bucket_arn,
        "configuration": configuration,
    }
    if version_token is not None:
        input_["version_token"] = version_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output