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
- get (all properties)
- list (identifiers only)
| 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. |
| Name | Datatype | Description |
|---|---|---|
collection_endpoint | string | The endpoint for the collection. |
index_name | string | The name of the OpenSearch Serverless index. |
region | string | AWS region. |
For more information, see AWS::OpenSearchServerless::Index.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | indices | INSERT | CollectionEndpoint, IndexName, region |
delete_resource | indices | DELETE | Identifier, region |
update_resource | indices | UPDATE | Identifier, PatchDocument, region |
list_resources | indices_list_only | SELECT | region |
get_resource | indices | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all indices in a region.
SELECT
region,
index_name,
collection_endpoint
FROM awscc.opensearchserverless.indices_list_only
WHERE
region = 'us-east-1';
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
'{{ collection_endpoint }}',
'{{ index_name }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.opensearchserverless.indices (
CollectionEndpoint,
IndexName,
Settings,
Mappings,
region
)
SELECT
'{{ collection_endpoint }}',
'{{ index_name }}',
'{{ 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: collection_endpoint
value: '{{ collection_endpoint }}'
- name: index_name
value: '{{ index_name }}'
- name: settings
value:
index:
refresh_interval: '{{ refresh_interval }}'
knn: '{{ knn }}'
knn_algo_param_ef_search: '{{ knn_algo_param_ef_search }}'
- name: mappings
value:
properties: {}
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:
- Create
- Read
- Update
- Delete
- List
aoss:APIAccessAll
aoss:APIAccessAll
aoss:APIAccessAll
aoss:APIAccessAll
aoss:APIAccessAll