document_contents
Creates, updates, deletes, gets or lists a document_contents resource.
Overview
| Name | document_contents |
| Type | Resource |
| Id | aws.bedrock_agent_runtime.document_contents |
Fields
The following fields are returned by SELECT queries:
- get_document_content
| Name | Datatype | Description |
|---|---|---|
document_content_length | integer (int64) | The size of the document content in bytes available at the pre-signed URL. |
mime_type | string | The MIME type of the document content. For RAW format, this is the original file type (for example, application/pdf). For EXTRACTED format, this is always application/json. |
presigned_url | string | A pre-signed URL for downloading the document content. The URL expires after 5 minutes. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_document_content | select | data_source_id, document_id, knowledge_base_id, region | Retrieves the content of an ingested document from a knowledge base. Returns a pre-signed URL for secure document access. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
data_source_id | string | The unique identifier of the data source that contains the document. |
document_id | string | The unique identifier of the document to retrieve content for. |
knowledge_base_id | string | The unique identifier of the knowledge base that contains the document. |
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_document_content
Retrieves the content of an ingested document from a knowledge base. Returns a pre-signed URL for secure document access.
SELECT
document_content_length,
mime_type,
presigned_url
FROM aws.bedrock_agent_runtime.document_contents
WHERE data_source_id = '{{ data_source_id }}' -- required
AND document_id = '{{ document_id }}' -- required
AND knowledge_base_id = '{{ knowledge_base_id }}' -- required
AND region = '{{ region }}' -- required
;