indices
Creates, updates, deletes or gets an index resource or lists indices in a region
Overview
| Name | indices |
| Type | Resource |
| Description | An OpenSearch Serverless index resource |
| Id | awscc.opensearchserverless.indices |
Fields
| Name | Datatype | Description |
|---|---|---|
collection_endpoint | string | The endpoint for the collection. |
index_name | string | The name of the OpenSearch Serverless index. |
settings | object | Index settings |
mappings | object | Index Mappings |
uuid | string | The unique identifier for the index. |
region | string | AWS region. |
For more information, see AWS::OpenSearchServerless::Index.
Methods
| Name | Accessible by | Required Params |
|---|---|---|
create_resource | INSERT | CollectionEndpoint, IndexName, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, 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 data__Identifier = '<IndexName>|<CollectionEndpoint>';
INSERT example
Use the following StackQL query and manifest file to create a new index resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.opensearchserverless.indices (
CollectionEndpoint,
IndexName,
region
)
SELECT
'{{ CollectionEndpoint }}',
'{{ IndexName }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.opensearchserverless.indices (
CollectionEndpoint,
IndexName,
Settings,
Mappings,
region
)
SELECT
'{{ CollectionEndpoint }}',
'{{ IndexName }}',
'{{ Settings }}',
'{{ Mappings }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: index
props:
- name: CollectionEndpoint
value: '{{ CollectionEndpoint }}'
- name: IndexName
value: '{{ IndexName }}'
- name: Settings
value:
Index:
RefreshInterval: '{{ RefreshInterval }}'
Knn: '{{ Knn }}'
KnnAlgoParamEfSearch: '{{ KnnAlgoParamEfSearch }}'
- name: Mappings
value:
Properties: {}
DELETE example
/*+ delete */
DELETE FROM awscc.opensearchserverless.indices
WHERE data__Identifier = '<IndexName|CollectionEndpoint>'
AND region = 'us-east-1';
Permissions
To operate on the indices resource, the following permissions are required:
Create
aoss:APIAccessAll
Read
aoss:APIAccessAll
Update
aoss:APIAccessAll
Delete
aoss:APIAccessAll
List
aoss:APIAccessAll