OpenSearchServiceServerless / Client / create_ingestion_stream
create_ingestion_stream¶
- OpenSearchServiceServerless.Client.create_ingestion_stream(**kwargs)¶
Creates an ingestion stream that continuously ingests data from an Amazon S3 bucket into an index in an OpenSearch Serverless collection. An ingestion stream processes Amazon S3 event notifications delivered to an Amazon SQS queue and ingests new objects as they arrive. The stream continues to ingest data until you delete it. To perform a one-time bulk ingestion instead, use
CreateIngestionJob.See also: AWS API Documentation
Request Syntax
response = client.create_ingestion_stream( collectionId='string', ingestionStreamName='string', indexName='string', failureIndexName='string', source={ 's3': { 'sqsArn': 'string', 'buckets': [ { 'bucket': 'string', 'bucketOwnerAccountId': 'string', 'initialScan': 'ENABLED'|'DISABLED' }, ] } }, roleArn='string', tags=[ { 'key': 'string', 'value': 'string' }, ], clientToken='string' )
- Parameters:
collectionId (string) –
[REQUIRED]
The unique identifier of the collection to ingest data into.
ingestionStreamName (string) –
[REQUIRED]
The name of the ingestion stream. The name must be unique within the collection.
indexName (string) –
[REQUIRED]
The name of the index to ingest documents into.
failureIndexName (string) – The name of the index where documents that fail to be ingested are recorded.
source (dict) –
[REQUIRED]
The Amazon S3 source to ingest data from, including the Amazon SQS queue that receives S3 event notifications.
s3 (dict) – [REQUIRED]
The Amazon S3 source configuration for the ingestion stream.
sqsArn (string) – [REQUIRED]
The Amazon Resource Name (ARN) of the Amazon SQS queue that receives Amazon S3 event notifications for the source buckets.
buckets (list) –
The configuration for each Amazon S3 bucket that the ingestion stream ingests data from.
(dict) –
S3 bucket configuration for SQS-driven ingestion. The scan mode controls only the optional one-time delta scan of existing objects in this bucket.
bucket (string) – [REQUIRED]
The name or Amazon Resource Name (ARN) of the Amazon S3 bucket to ingest data from.
bucketOwnerAccountId (string) –
The AWS account ID that owns the S3 bucket. Optional. If omitted, the control plane derives it from the account segment of sqsArn.
initialScan (string) –
Specifies whether to perform a one-time scan of the objects that already exist in the bucket before the stream begins processing Amazon S3 event notifications. If
DISABLED, only new objects are ingested.
roleArn (string) –
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM role that OpenSearch Serverless assumes to read data from the source. The role must be in the same account as the collection.
tags (list) –
An arbitrary set of tags (key–value pairs) to associate with the ingestion stream.
(dict) –
A map of key-value pairs associated to an OpenSearch Serverless resource.
key (string) – [REQUIRED]
The key to use in the tag.
value (string) – [REQUIRED]
The value of the tag.
clientToken (string) –
Unique, case-sensitive identifier to ensure idempotency of the request.
This field is autopopulated if not provided.
- Return type:
dict
- Returns:
Response Syntax
{ 'ingestionStreamDetail': { 'ingestionStreamId': 'string', 'arn': 'string', 'collectionId': 'string', 'ingestionStreamName': 'string', 'indexName': 'string', 'failureIndexName': 'string', 'source': { 's3': { 'sqsArn': 'string', 'buckets': [ { 'bucket': 'string', 'bucketOwnerAccountId': 'string', 'initialScan': 'ENABLED'|'DISABLED' }, ] } }, 'roleArn': 'string', 'status': 'CREATING'|'ACTIVE'|'DELETING'|'DELETED'|'CREATE_FAILED'|'DELETE_FAILED', 'state': 'STARTING'|'SCANNING'|'INGESTION_IN_PROGRESS'|'INGESTION_COMPLETE'|'STOPPED'|'FAILED', 'statistics': { 's3': { 'objectsDiscovered': 123, 'objectsIngested': 123, 'objectsFailed': 123 } }, 'revision': 123, 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1), 'failureReasons': [ { 'code': 'SOURCE_ACCESS_DENIED'|'SOURCE_RESOURCE_NOT_FOUND'|'DESTINATION_ACCESS_DENIED'|'DESTINATION_RESOURCE_NOT_FOUND'|'INTERNAL_SERVER_ERROR', 'message': 'string' }, ], 'activeAlerts': [ { 'code': 'SOURCE_ACCESS_DENIED'|'SOURCE_RESOURCE_NOT_FOUND'|'DESTINATION_ACCESS_DENIED'|'DESTINATION_RESOURCE_NOT_FOUND'|'INTERNAL_SERVER_ERROR', 'message': 'string' }, ] } }
Response Structure
(dict) –
ingestionStreamDetail (dict) –
Details about the created ingestion stream.
ingestionStreamId (string) –
The unique identifier of the ingestion stream.
arn (string) –
The Amazon Resource Name (ARN) of the ingestion stream.
collectionId (string) –
The unique identifier of the collection that the ingestion stream belongs to.
ingestionStreamName (string) –
The name of the ingestion stream.
indexName (string) –
The name of the index that documents are ingested into.
failureIndexName (string) –
The name of the index where documents that fail to be ingested are recorded.
source (dict) –
The Amazon S3 source that the ingestion stream ingests data from.
s3 (dict) –
The Amazon S3 source configuration for the ingestion stream.
sqsArn (string) –
The Amazon Resource Name (ARN) of the Amazon SQS queue that receives Amazon S3 event notifications for the source buckets.
buckets (list) –
The configuration for each Amazon S3 bucket that the ingestion stream ingests data from.
(dict) –
S3 bucket configuration for SQS-driven ingestion. The scan mode controls only the optional one-time delta scan of existing objects in this bucket.
bucket (string) –
The name or Amazon Resource Name (ARN) of the Amazon S3 bucket to ingest data from.
bucketOwnerAccountId (string) –
The AWS account ID that owns the S3 bucket. Optional. If omitted, the control plane derives it from the account segment of sqsArn.
initialScan (string) –
Specifies whether to perform a one-time scan of the objects that already exist in the bucket before the stream begins processing Amazon S3 event notifications. If
DISABLED, only new objects are ingested.
roleArn (string) –
The Amazon Resource Name (ARN) of the IAM role that OpenSearch Serverless assumes to read data from the source.
status (string) –
The current lifecycle status of the ingestion stream. For example,
CREATING,ACTIVE, orDELETING.state (string) –
The current processing state of the ingestion stream. For example,
STARTINGorINGESTION_IN_PROGRESS.statistics (dict) –
Processing statistics for the ingestion stream, such as the number of Amazon S3 objects discovered, ingested, and failed.
s3 (dict) –
Processing statistics for the Amazon S3 source.
objectsDiscovered (integer) –
The number of Amazon S3 objects discovered for ingestion.
objectsIngested (integer) –
The number of Amazon S3 objects successfully ingested.
objectsFailed (integer) –
The number of Amazon S3 objects that failed to be ingested.
revision (integer) –
The revision number of the ingestion stream.
createdAt (datetime) –
The date and time when the ingestion stream was created.
updatedAt (datetime) –
The date and time when the ingestion stream was last updated.
failureReasons (list) –
The reasons that the ingestion stream reached a terminal failure state, if applicable.
(dict) –
A terminal failure reason explaining why an ingestion stopped.
code (string) –
The code that identifies the reason for the failure.
message (string) –
A description of the reason for the failure.
activeAlerts (list) –
Active alerts about operational issues that currently affect the ingestion stream. Alerts are cleared when the issue is resolved.
(dict) –
An active alert about a running ingestion — operational issues or updates to processing state. Cleared when the issue resolves.
code (string) –
The code that identifies the alert.
message (string) –
A description of the alert.
Exceptions
OpenSearchServiceServerless.Client.exceptions.InternalServerExceptionOpenSearchServiceServerless.Client.exceptions.ConflictExceptionOpenSearchServiceServerless.Client.exceptions.ResourceNotFoundExceptionOpenSearchServiceServerless.Client.exceptions.ValidationExceptionOpenSearchServiceServerless.Client.exceptions.ServiceQuotaExceededException