Skip to content

start_db_instance_automated_backups_replication

start_db_instance_automated_backups_replication(
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    source_db_instance_arn: Optional[String] = None,
    backup_retention_period: Optional[IntegerOptional] = None,
    kms_key_id: Optional[String] = None,
    pre_signed_url: Optional[SensitiveString] = None,
    tags: Optional[TagList] = None,
) -> StartDBInstanceAutomatedBackupsReplicationResult

Enables replication of automated backups to a different Amazon Web Services Region.

This command doesn't apply to RDS Custom.

For more information, see Replicating Automated Backups to Another Amazon Web Services Region in the Amazon RDS User Guide.

Parameters:

  • source_db_instance_arn (Optional[String], default: None ) –

    The Amazon Resource Name (ARN) of the source DB instance for the replicated automated backups, for example, arn:aws:rds:us-west-2:123456789012:db:mydatabase.

  • backup_retention_period (Optional[IntegerOptional], default: None ) –

    The retention period for the replicated automated backups.

  • kms_key_id (Optional[String], default: None ) –

    The Amazon Web Services KMS key identifier for encryption of the replicated automated backups. The KMS key ID is the Amazon Resource Name (ARN) for the KMS encryption key in the destination Amazon Web Services Region, for example, arn:aws:kms:us-east-1:123456789012:key/AKIAIOSFODNN7EXAMPLE.

  • pre_signed_url (Optional[SensitiveString], default: None ) –

    In an Amazon Web Services GovCloud (US) Region, an URL that contains a Signature Version 4 signed request for the StartDBInstanceAutomatedBackupsReplication operation to call in the Amazon Web Services Region of the source DB instance. The presigned URL must be a valid request for the StartDBInstanceAutomatedBackupsReplication API operation that can run in the Amazon Web Services Region that contains the source DB instance.

    This setting applies only to Amazon Web Services GovCloud (US) Regions. It's ignored in other Amazon Web Services Regions.

    To learn how to generate a Signature Version 4 signed request, see Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4) and Signature Version 4 Signing Process.

    If you are using an Amazon Web Services SDK tool or the CLI, you can specify SourceRegion (or --source-region for the CLI) instead of specifying PreSignedUrl manually. Specifying SourceRegion autogenerates a presigned URL that is a valid request for the operation that can run in the source Amazon Web Services Region.

  • tags (Optional[TagList], default: None ) –

    A list of tags to associate with the replicated automated backups.

Raises:

Examples:

To enable cross-Region automated backups The following example replicates automated backups from a DB instance in the US East (N. Virginia) Region. The backup retention period is 14 days.

>>> client.start_db_instance_automated_backups_replication(source_db_instance_arn='arn:aws:rds:us-east-1:123456789012:db:new-orcl-db', backup_retention_period=14)
Source code in docs_src/capo_rds/_services/rds.py
def start_db_instance_automated_backups_replication(
    self,
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    source_db_instance_arn: Optional["capo_rds.types.string.String"] = None,
    backup_retention_period: Optional[
        "capo_rds.types.integer_optional.IntegerOptional"
    ] = None,
    kms_key_id: Optional["capo_rds.types.string.String"] = None,
    pre_signed_url: Optional[
        "capo_rds.types.sensitive_string.SensitiveString"
    ] = None,
    tags: Optional["capo_rds.types.tag_list.TagList"] = None,
) -> "capo_rds.types.start_db_instance_automated_backups_replication_result.StartDBInstanceAutomatedBackupsReplicationResult":
    """<p>Enables replication of automated backups to a different Amazon Web Services Region.</p> <p>This command doesn't apply to RDS Custom.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReplicateBackups.html"> Replicating Automated Backups to Another Amazon Web Services Region</a> in the <i>Amazon RDS User Guide.</i> </p>

    Args:
        source_db_instance_arn: <p>The Amazon Resource Name (ARN) of the source DB instance for the replicated automated backups, for example, <code>arn:aws:rds:us-west-2:123456789012:db:mydatabase</code>.</p>
        backup_retention_period: <p>The retention period for the replicated automated backups.</p>
        kms_key_id: <p>The Amazon Web Services KMS key identifier for encryption of the replicated automated backups. The KMS key ID is the Amazon Resource Name (ARN) for the KMS encryption key in the destination Amazon Web Services Region, for example, <code>arn:aws:kms:us-east-1:123456789012:key/AKIAIOSFODNN7EXAMPLE</code>.</p>
        pre_signed_url: <p>In an Amazon Web Services GovCloud (US) Region, an URL that contains a Signature Version 4 signed request for the <code>StartDBInstanceAutomatedBackupsReplication</code> operation to call in the Amazon Web Services Region of the source DB instance. The presigned URL must be a valid request for the <code>StartDBInstanceAutomatedBackupsReplication</code> API operation that can run in the Amazon Web Services Region that contains the source DB instance.</p> <p>This setting applies only to Amazon Web Services GovCloud (US) Regions. It's ignored in other Amazon Web Services Regions.</p> <p>To learn how to generate a Signature Version 4 signed request, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html"> Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)</a> and <a href="https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html"> Signature Version 4 Signing Process</a>.</p> <note> <p>If you are using an Amazon Web Services SDK tool or the CLI, you can specify <code>SourceRegion</code> (or <code>--source-region</code> for the CLI) instead of specifying <code>PreSignedUrl</code> manually. Specifying <code>SourceRegion</code> autogenerates a presigned URL that is a valid request for the operation that can run in the source Amazon Web Services Region.</p> </note>
        tags: <p>A list of tags to associate with the replicated automated backups.</p>

    Raises:
        capo_rds.errors.db_instance_automated_backup_quota_exceeded_fault.DBInstanceAutomatedBackupQuotaExceededFault: <p>The quota for retained automated backups was exceeded. This prevents you from retaining any additional automated backups. The retained automated backups quota is the same as your DB instance quota.</p>
        capo_rds.errors.db_instance_not_found_fault.DBInstanceNotFoundFault: <p> <code>DBInstanceIdentifier</code> doesn't refer to an existing DB instance.</p>
        capo_rds.errors.invalid_db_instance_automated_backup_state_fault.InvalidDBInstanceAutomatedBackupStateFault: <p>The automated backup is in an invalid state. For example, this automated backup is associated with an active instance.</p>
        capo_rds.errors.invalid_db_instance_state_fault.InvalidDBInstanceStateFault: <p>The DB instance isn't in a valid state.</p>
        capo_rds.errors.kms_key_not_accessible_fault.KMSKeyNotAccessibleFault: <p>An error occurred accessing an Amazon Web Services KMS key.</p>
        capo_rds.errors.storage_type_not_supported_fault.StorageTypeNotSupportedFault: <p>The specified <code>StorageType</code> can't be associated with the DB instance.</p>
        capo_rds.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To enable cross-Region automated backups
        The following example replicates automated backups from a DB instance in the US East (N. Virginia) Region. The backup retention period is 14 days.

        >>> client.start_db_instance_automated_backups_replication(source_db_instance_arn='arn:aws:rds:us-east-1:123456789012:db:new-orcl-db', backup_retention_period=14)
    """

    def _handler(
        req: "OperationRequest[capo_rds.types.start_db_instance_automated_backups_replication_message.StartDBInstanceAutomatedBackupsReplicationMessage]",
    ) -> OperationResponse[
        "capo_rds.types.start_db_instance_automated_backups_replication_result.StartDBInstanceAutomatedBackupsReplicationResult"
    ]:
        import capo_rds._operations.amazon_rd_sv19.start_db_instance_automated_backups_replication

        output, http_response = (
            capo_rds._operations.amazon_rd_sv19.start_db_instance_automated_backups_replication.start_db_instance_automated_backups_replication(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_rds.types.start_db_instance_automated_backups_replication_message.StartDBInstanceAutomatedBackupsReplicationMessage",
    ) -> dict[str, Any]:
        import capo_rds.types.start_db_instance_automated_backups_replication_message

        return capo_rds.types.start_db_instance_automated_backups_replication_message.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "StartDBInstanceAutomatedBackupsReplication", redact_input=_redact_input
        ),
    )
    input_: capo_rds.types.start_db_instance_automated_backups_replication_message.StartDBInstanceAutomatedBackupsReplicationMessage = {}
    if source_db_instance_arn is not None:
        input_["source_db_instance_arn"] = source_db_instance_arn
    if backup_retention_period is not None:
        input_["backup_retention_period"] = backup_retention_period
    if kms_key_id is not None:
        input_["kms_key_id"] = kms_key_id
    if pre_signed_url is not None:
        input_["pre_signed_url"] = pre_signed_url
    if tags is not None:
        input_["tags"] = tags

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