AWS::OpenSearchServerless::Collection - AWS CloudFormation


Specifies an OpenSearch Serverless collection. For more information, see Creating and managing Amazon OpenSearch Serverless collections in the Amazon OpenSearch Service Developer Guide.


You must create a matching encryption policy in order for a collection to be created successfully. You can specify the policy resource within the same CloudFormation template as the collection resource if you use the DependsOn attribute. See Examples for a sample template. Otherwise the encryption policy must already exist before you create the collection.


To declare this entity in your AWS CloudFormation template, use the following syntax:


{ "Type" : "AWS::OpenSearchServerless::Collection", "Properties" : { "Description" : String, "Name" : String, "Tags" : [ Tag, ... ], "Type" : String } }


Type: AWS::OpenSearchServerless::Collection Properties: Description: String Name: String Tags: - Tag Type: String



A description of the collection.

Required: No

Type: String

Update requires: No interruption


The name of the collection.

Collection names must meet the following criteria:

  • Starts with a lowercase letter

  • Unique to your account and AWS Region

  • Contains between 3 and 28 characters

  • Contains only lowercase letters a-z, the numbers 0-9, and the hyphen (-)

Required: Yes

Type: String

Update requires: Replacement


An arbitrary set of tags (key–value pairs) to associate with the collection.

For more information, see Tag.

Required: No

Type: List of Tag

Update requires: Replacement


The type of collection. Possible values are SEARCH and TIMESERIES. For more information, see Choosing a collection type.

Required: No

Type: String

Update requires: Replacement

Return values


When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the collection ID. For more information about using the Ref function, see Ref.


GetAtt returns a value for a specified attribute of this type. For more information, see Fn::GetAtt. The following are the available attributes and sample return values.


The Amazon Resource Name (ARN) of the collection. For example, arn:aws:aoss:us-east-1:123456789012:collection/07tjusf2h91cunochc.


Collection-specific endpoint used to submit index, search, and data upload requests to an OpenSearch Serverless collection. For example,


Collection-specific endpoint used to access OpenSearch Dashboards. For example,


A unique identifier for the collection. For example, 07tjusf2h91cunochc.


Create a collection

The following example specifies an OpenSearch Serverless collection named test-collection. The collection type is SEARCH. The template also creates a matching encryption policy, which is required in order for the collection to be created successfully.

For a complete sample policy that creates network, encryption, and access policies, as well as a matching collection, see Using AWS CloudFormation to create Amazon OpenSearch Serverless collections in the Amazon OpenSearch Service Developer Guide.


This example uses public network access, which isn't recommended for production workloads. We recommend using VPC access to protect your collections. For more information, see AWS::OpenSearchServerless::VpcEndpoint and Access Amazon OpenSearch Serverless using an interface endpoint.


{ "AWSTemplateFormatVersion": "2010-09-09", "Description": "OpenSearch Serverless collection template", "Resources": { "TestCollection": { "Type": "AWS::OpenSearchServerless::Collection", "Properties": { "Name": "test-collection", "Type": "SEARCH", "Description": "Search collection" }, "DependsOn": "EncryptionPolicy" }, "EncryptionPolicy": { "Type": "AWS::OpenSearchServerless::SecurityPolicy", "Properties": { "Name": "test-encryption-policy", "Type": "encryption", "Description": "Encryption policy for test collection", "Policy": "{\"Rules\":[{\"ResourceType\":\"collection\",\"Resource\":[\"collection/test-collection\"]}],\"AWSOwnedKey\":true}" } } } }


AWSTemplateFormatVersion: 2010-09-09 Description: 'OpenSearch Serverless collection template' Resources: TestCollection: Type: 'AWS::OpenSearchServerless::Collection' Properties: Name: test-collection Type: SEARCH Description: Search collection DependsOn: EncryptionPolicy EncryptionPolicy: Type: 'AWS::OpenSearchServerless::SecurityPolicy' Properties: Name: test-encryption-policy Type: encryption Description: Encryption policy for test collection Policy: >- {"Rules":[{"ResourceType":"collection","Resource":["collection/test-collection"]}],"AWSOwnedKey":true}