AWS::OpenSearchServerless::Collection - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


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 Amazon CloudFormation template, use the following syntax:


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


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



A description of the collection.

Required: No

Type: String

Maximum: 1000

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 Amazon Region

  • Contains between 3 and 28 characters

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

Required: Yes

Type: String

Pattern: ^[a-z][a-z0-9-]{2,31}$

Minimum: 3

Maximum: 32

Update requires: Replacement


Indicates whether to use standby replicas for the collection. You can't update this property after the collection is already created. If you attempt to modify this property, the collection continues to use the original value.

Required: No

Type: String

Allowed values: ENABLED | DISABLED

Update requires: No interruption


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

For more information, see Tag.

Required: No

Type: Array of Tag

Minimum: 0

Maximum: 50

Update requires: Replacement


The type of collection. Possible values are SEARCH, TIMESERIES, and VECTORSEARCH. 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,


The 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 Amazon 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.


{ "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}" } } }


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}