Skip to content

describe_db_instances

describe_db_instances(
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    db_instance_identifier: Optional[String] = None,
    filters: Optional[FilterList] = None,
    max_records: Optional[IntegerOptional] = None,
    marker: Optional[String] = None,
) -> DBInstanceMessage

Describes provisioned RDS instances. This API supports pagination.

This operation can also return information for Amazon Neptune DB instances and Amazon DocumentDB instances.

Parameters:

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

    The user-supplied instance identifier or the Amazon Resource Name (ARN) of the DB instance. If this parameter is specified, information from only the specific DB instance is returned. This parameter isn't case-sensitive.

    Constraints:

    • If supplied, must match the identifier of an existing DB instance.

  • filters (Optional[FilterList], default: None ) –

    A filter that specifies one or more DB instances to describe.

    Supported Filters:

    • db-cluster-id - Accepts DB cluster identifiers and DB cluster Amazon Resource Names (ARNs). The results list only includes information about the DB instances associated with the DB clusters identified by these ARNs.

    • db-instance-id - Accepts DB instance identifiers and DB instance Amazon Resource Names (ARNs). The results list only includes information about the DB instances identified by these ARNs.

    • dbi-resource-id - Accepts DB instance resource identifiers. The results list only includes information about the DB instances identified by these DB instance resource identifiers.

    • domain - Accepts Active Directory directory IDs. The results list only includes information about the DB instances associated with these domains.

    • engine - Accepts engine names. The results list only includes information about the DB instances for these engines.

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

    The maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a pagination token called a marker is included in the response so that you can retrieve the remaining results.

    Default: 100

    Constraints: Minimum 20, maximum 100.

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

    An optional pagination token provided by a previous DescribeDBInstances request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.

Raises:

Examples:

To describe a DB instance The following example retrieves details about the specified DB instance.

>>> client.describe_db_instances(db_instance_identifier='mydbinstancecf')
Source code in docs_src/capo_rds/_services/rds.py
def describe_db_instances(
    self,
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    db_instance_identifier: Optional["capo_rds.types.string.String"] = None,
    filters: Optional["capo_rds.types.filter_list.FilterList"] = None,
    max_records: Optional["capo_rds.types.integer_optional.IntegerOptional"] = None,
    marker: Optional["capo_rds.types.string.String"] = None,
) -> "capo_rds.types.db_instance_message.DBInstanceMessage":
    """<p>Describes provisioned RDS instances. This API supports pagination.</p> <note> <p>This operation can also return information for Amazon Neptune DB instances and Amazon DocumentDB instances.</p> </note>

    Args:
        db_instance_identifier: <p>The user-supplied instance identifier or the Amazon Resource Name (ARN) of the DB instance. If this parameter is specified, information from only the specific DB instance is returned. This parameter isn't case-sensitive.</p> <p>Constraints:</p> <ul> <li> <p>If supplied, must match the identifier of an existing DB instance.</p> </li> </ul>
        filters: <p>A filter that specifies one or more DB instances to describe.</p> <p>Supported Filters:</p> <ul> <li> <p> <code>db-cluster-id</code> - Accepts DB cluster identifiers and DB cluster Amazon Resource Names (ARNs). The results list only includes information about the DB instances associated with the DB clusters identified by these ARNs.</p> </li> <li> <p> <code>db-instance-id</code> - Accepts DB instance identifiers and DB instance Amazon Resource Names (ARNs). The results list only includes information about the DB instances identified by these ARNs.</p> </li> <li> <p> <code>dbi-resource-id</code> - Accepts DB instance resource identifiers. The results list only includes information about the DB instances identified by these DB instance resource identifiers.</p> </li> <li> <p> <code>domain</code> - Accepts Active Directory directory IDs. The results list only includes information about the DB instances associated with these domains.</p> </li> <li> <p> <code>engine</code> - Accepts engine names. The results list only includes information about the DB instances for these engines.</p> </li> </ul>
        max_records: <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a pagination token called a marker is included in the response so that you can retrieve the remaining results.</p> <p>Default: 100</p> <p>Constraints: Minimum 20, maximum 100.</p>
        marker: <p>An optional pagination token provided by a previous <code>DescribeDBInstances</code> request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>

    Raises:
        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.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe a DB instance
        The following example retrieves details about the specified DB instance.

        >>> client.describe_db_instances(db_instance_identifier='mydbinstancecf')
    """

    def _handler(
        req: "OperationRequest[capo_rds.types.describe_db_instances_message.DescribeDBInstancesMessage]",
    ) -> OperationResponse["capo_rds.types.db_instance_message.DBInstanceMessage"]:
        import capo_rds._operations.amazon_rd_sv19.describe_db_instances

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

    def _redact_output(
        output: "capo_rds.types.db_instance_message.DBInstanceMessage",
    ) -> dict[str, Any]:
        import capo_rds.types.db_instance_message

        return capo_rds.types.db_instance_message.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DescribeDBInstances", redact_output=_redact_output),
    )
    input_: capo_rds.types.describe_db_instances_message.DescribeDBInstancesMessage = {}
    if db_instance_identifier is not None:
        input_["db_instance_identifier"] = db_instance_identifier
    if filters is not None:
        input_["filters"] = filters
    if max_records is not None:
        input_["max_records"] = max_records
    if marker is not None:
        input_["marker"] = marker

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