Skip to main content

indices

Creates, updates, deletes or gets an index resource or lists indices in a region

Overview

Nameindices
TypeResource
DescriptionAn OpenSearch Serverless index resource
Idawscc.opensearchserverless.indices

Fields

NameDatatypeDescription
collection_endpointstringThe endpoint for the collection.
index_namestringThe name of the OpenSearch Serverless index.
settingsobjectIndex settings
mappingsobjectIndex Mappings
uuidstringThe unique identifier for the index.
regionstringAWS region.

For more information, see AWS::OpenSearchServerless::Index.

Methods

NameResourceAccessible byRequired Params
create_resourceindicesINSERTCollectionEndpoint, IndexName, region
delete_resourceindicesDELETEIdentifier, region
update_resourceindicesUPDATEIdentifier, PatchDocument, region
list_resourcesindices_list_onlySELECTregion
get_resourceindicesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual index.

SELECT
region,
collection_endpoint,
index_name,
settings,
mappings,
uuid
FROM awscc.opensearchserverless.indices
WHERE
region = 'us-east-1' AND
Identifier = '{{ index_name }}|{{ collection_endpoint }}';

INSERT example

Use the following StackQL query and manifest file to create a new index resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.opensearchserverless.indices (
CollectionEndpoint,
IndexName,
region
)
SELECT
'{{ collection_endpoint }}',
'{{ index_name }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a index resource, using stack-deploy.

/*+ update */
UPDATE awscc.opensearchserverless.indices
SET PatchDocument = string('{{ {
"Settings": settings,
"Mappings": mappings
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ index_name }}|{{ collection_endpoint }}';

DELETE example

/*+ delete */
DELETE FROM awscc.opensearchserverless.indices
WHERE
Identifier = '{{ index_name }}|{{ collection_endpoint }}' AND
region = 'us-east-1';

Permissions

To operate on the indices resource, the following permissions are required:

aoss:APIAccessAll