Skip to main content

collections

Creates, updates, deletes, gets or lists a collections resource.

Overview

Namecollections
TypeResource
Idaws.opensearchserverless.collections

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
collection_summariesarrayDetails about each collection.
next_tokenstringWhen nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_collectionsselectregionLists all OpenSearch Serverless collections. For more information, see Creating and managing Amazon OpenSearch Serverless collections. Make sure to include an empty request body {} if you don't include any collection filters in the request.
create_collectioninsertregion, nameCreates a new OpenSearch Serverless collection. For more information, see Creating and managing Amazon OpenSearch Serverless collections.
update_collectionupdateregion, idUpdates an OpenSearch Serverless collection.
delete_collectiondeleteregionDeletes an OpenSearch Serverless collection. For more information, see Creating and managing Amazon OpenSearch Serverless collections.
batch_get_collectionexecregionReturns attributes for one or more collections, including the collection endpoint, the OpenSearch Dashboards endpoint, and FIPS-compliant endpoints. For more information, see Creating and managing Amazon OpenSearch Serverless collections.

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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Lists all OpenSearch Serverless collections. For more information, see Creating and managing Amazon OpenSearch Serverless collections. Make sure to include an empty request body {} if you don't include any collection filters in the request.

SELECT
collection_summaries,
next_token
FROM aws.opensearchserverless.collections
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a new OpenSearch Serverless collection. For more information, see Creating and managing Amazon OpenSearch Serverless collections.

INSERT INTO aws.opensearchserverless.collections (
name,
type,
description,
tags,
standbyReplicas,
vectorOptions,
collectionGroupName,
encryptionConfig,
deletionProtection,
clientToken,
region
)
SELECT
'{{ name }}' /* required */,
'{{ type }}',
'{{ description }}',
'{{ tags }}',
'{{ standbyReplicas }}',
'{{ vectorOptions }}',
'{{ collectionGroupName }}',
'{{ encryptionConfig }}',
'{{ deletionProtection }}',
'{{ clientToken }}',
'{{ region }}'
RETURNING
create_collection_detail
;

UPDATE examples

Updates an OpenSearch Serverless collection.

UPDATE aws.opensearchserverless.collections
SET
id = '{{ id }}',
description = '{{ description }}',
vectorOptions = '{{ vectorOptions }}',
deletionProtection = '{{ deletionProtection }}',
clientToken = '{{ clientToken }}'
WHERE
region = '{{ region }}' --required
AND id = '{{ id }}' --required
RETURNING
update_collection_detail;

DELETE examples

Deletes an OpenSearch Serverless collection. For more information, see Creating and managing Amazon OpenSearch Serverless collections.

DELETE FROM aws.opensearchserverless.collections
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Returns attributes for one or more collections, including the collection endpoint, the OpenSearch Dashboards endpoint, and FIPS-compliant endpoints. For more information, see Creating and managing Amazon OpenSearch Serverless collections.

EXEC aws.opensearchserverless.collections.batch_get_collection
@region='{{ region }}' --required
@@json=
'{
"ids": "{{ ids }}",
"names": "{{ names }}"
}'
;