Skip to content

delete_db_instance_automated_backup

delete_db_instance_automated_backup(
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    dbi_resource_id: Optional[String] = None,
    db_instance_automated_backups_arn: Optional[String] = None,
) -> DeleteDBInstanceAutomatedBackupResult

Deletes automated backups using the DbiResourceId value of the source DB instance or the Amazon Resource Name (ARN) of the automated backups.

Parameters:

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

    The identifier for the source DB instance, which can't be changed and which is unique to an Amazon Web Services Region.

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

    The Amazon Resource Name (ARN) of the automated backups to delete, for example, arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE.

    This setting doesn't apply to RDS Custom.

Raises:

Examples:

To delete a replicated automated backup from a Region The following example deletes the automated backup with the specified Amazon Resource Name (ARN).

>>> client.delete_db_instance_automated_backup(db_instance_automated_backups_arn='arn:aws:rds:us-west-2:123456789012:auto-backup:ab-jkib2gfq5rv7replzadausbrktni2bn4example')
Source code in docs_src/capo_rds/_services/rds.py
def delete_db_instance_automated_backup(
    self,
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    dbi_resource_id: Optional["capo_rds.types.string.String"] = None,
    db_instance_automated_backups_arn: Optional[
        "capo_rds.types.string.String"
    ] = None,
) -> "capo_rds.types.delete_db_instance_automated_backup_result.DeleteDBInstanceAutomatedBackupResult":
    """<p>Deletes automated backups using the <code>DbiResourceId</code> value of the source DB instance or the Amazon Resource Name (ARN) of the automated backups.</p>

    Args:
        dbi_resource_id: <p>The identifier for the source DB instance, which can't be changed and which is unique to an Amazon Web Services Region.</p>
        db_instance_automated_backups_arn: <p>The Amazon Resource Name (ARN) of the automated backups to delete, for example, <code>arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE</code>.</p> <p>This setting doesn't apply to RDS Custom.</p>

    Raises:
        capo_rds.errors.db_instance_automated_backup_not_found_fault.DBInstanceAutomatedBackupNotFoundFault: <p>No automated backup for this DB instance was found.</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.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To delete a replicated automated backup from a Region
        The following example deletes the automated backup with the specified Amazon Resource Name (ARN).

        >>> client.delete_db_instance_automated_backup(db_instance_automated_backups_arn='arn:aws:rds:us-west-2:123456789012:auto-backup:ab-jkib2gfq5rv7replzadausbrktni2bn4example')
    """

    def _handler(
        req: "OperationRequest[capo_rds.types.delete_db_instance_automated_backup_message.DeleteDBInstanceAutomatedBackupMessage]",
    ) -> OperationResponse[
        "capo_rds.types.delete_db_instance_automated_backup_result.DeleteDBInstanceAutomatedBackupResult"
    ]:
        import capo_rds._operations.amazon_rd_sv19.delete_db_instance_automated_backup

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteDBInstanceAutomatedBackup")
    )
    input_: capo_rds.types.delete_db_instance_automated_backup_message.DeleteDBInstanceAutomatedBackupMessage = {}
    if dbi_resource_id is not None:
        input_["dbi_resource_id"] = dbi_resource_id
    if db_instance_automated_backups_arn is not None:
        input_["db_instance_automated_backups_arn"] = (
            db_instance_automated_backups_arn
        )

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