Create security policy before creating new collection?

0
"https response error StatusCode: 400, RequestID: ****, ValidationException: No matching security policy of encryption type found for collection name: test. Please create security policy of encryption type for this collection.

I'm getting the above error when trying to create a collection in OpenSearch serverless (via the Go SDK)

I'm sure I'm doing something wrong, but am confused by this error message. In the input: https://docs.aws.amazon.com/opensearch-service/latest/ServerlessAPIReference/API_CreateCollection.html there isn't a field where you can specify a security policy that the collection should have.

Am I missing a step before I try creating the collection?

asked a year ago774 views
1 Answer
2
Accepted Answer

EncryptionPolicy should be created prior to creating the collection. Can you try creating an encryption policy first using https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/opensearchserverless#Client.CreateSecurityPolicy and then create collection.

I think it's not mentioned on API docs, but seems to be mentioned here in the product page: https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-manage.html#:~:text=Create%20a%20collection%20(CLI)

AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions