collections
Creates, updates, deletes or gets a collection
resource or lists collections
in a region
Overview
Name | collections |
Type | Resource |
Description | Amazon OpenSearchServerless collection resource |
Id | aws.opensearchserverless.collections |
Fields
Name | Datatype | Description |
---|---|---|
description | string | The description of the collection |
id | string | The identifier of the collection |
name | string | The name of the collection. The name must meet the following criteria: Unique to your account and AWS Region Starts with a lowercase letter Contains only lowercase letters a-z, the numbers 0-9 and the hyphen (-) Contains between 3 and 32 characters |
tags | array | List of tags to be added to the resource |
arn | string | The Amazon Resource Name (ARN) of the collection. |
collection_endpoint | string | The endpoint for the collection. |
dashboard_endpoint | string | The OpenSearch Dashboards endpoint for the collection. |
type | string | The possible types for the collection |
standby_replicas | string | The possible standby replicas for the collection |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Name, 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 collections
in a region.
SELECT
region,
description,
id,
name,
tags,
arn,
collection_endpoint,
dashboard_endpoint,
type,
standby_replicas
FROM aws.opensearchserverless.collections
WHERE region = 'us-east-1';
Gets all properties from an individual collection
.
SELECT
region,
description,
id,
name,
tags,
arn,
collection_endpoint,
dashboard_endpoint,
type,
standby_replicas
FROM aws.opensearchserverless.collections
WHERE region = 'us-east-1' AND data__Identifier = '<Id>';
INSERT
example
Use the following StackQL query and manifest file to create a new collection
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.opensearchserverless.collections (
Name,
region
)
SELECT
'{{ Name }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.opensearchserverless.collections (
Description,
Name,
Tags,
Type,
StandbyReplicas,
region
)
SELECT
'{{ Description }}',
'{{ Name }}',
'{{ Tags }}',
'{{ Type }}',
'{{ StandbyReplicas }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: collection
props:
- name: Description
value: '{{ Description }}'
- name: Name
value: '{{ Name }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
- name: Type
value: '{{ Type }}'
- name: StandbyReplicas
value: '{{ StandbyReplicas }}'
DELETE
example
/*+ delete */
DELETE FROM aws.opensearchserverless.collections
WHERE data__Identifier = '<Id>'
AND region = 'us-east-1';
Permissions
To operate on the collections
resource, the following permissions are required:
Create
aoss:CreateCollection,
aoss:BatchGetCollection,
iam:CreateServiceLinkedRole
Delete
aoss:DeleteCollection,
aoss:BatchGetCollection
List
aoss:ListCollections
Read
aoss:BatchGetCollection
Update
aoss:UpdateCollection,
aoss:BatchGetCollection