Chapter 45 · Amazon Opensearch Service
Subchapter 45.24
references/provisioning-serverless-provision.mdMarkdown4 KBView on GitHub
aws sts get-caller-identityRequired before collection creation:
aws opensearchserverless create-security-policy \
--name <collection-name>-encryption --type encryption \
--policy '{"Rules":[{"ResourceType":"collection","Resource":["collection/<collection-name>"]}],"AWSOwnedKey":true}'For compliance workloads (PCI-DSS, HIPAA), use customer-managed keys: set
AWSOwnedKey:falseand provide a CMK ARN.
Production (recommended): Use VPC endpoint for secure private access:
aws opensearchserverless create-security-policy \
--name <collection-name>-network --type network \
--policy '[{"Rules":[{"ResourceType":"collection","Resource":["collection/<collection-name>"]},{"ResourceType":"dashboard","Resource":["collection/<collection-name>"]}],"VpceIds":["<vpce-id>"]}]'Last-resort dev/test (NOT for production): AllowFromPublic: true exposes the collection to the entire internet — there is no IP scoping or auth gate at the network layer. AWS Security Code Scanner flags this as an open-network default. Prefer one of:
# ⚠️ Public access — entire internet can reach the endpoint. Dev/test ONLY,
# and even then prefer VPC endpoint with SG-scoped CIDR (see Step 5 below).
aws opensearchserverless create-security-policy \
--name <collection-name>-network --type network \
--policy '[{"Rules":[{"ResourceType":"collection","Resource":["collection/<collection-name>"]},{"ResourceType":"dashboard","Resource":["collection/<collection-name>"]}],"AllowFromPublic":true}]'aws opensearchserverless create-access-policy \
--name <collection-name>-data --type data \
--policy '[{"Rules":[{"ResourceType":"index","Resource":["index/<collection-name>/*"],"Permission":["aoss:CreateIndex","aoss:DescribeIndex","aoss:UpdateIndex","aoss:DeleteIndex","aoss:ReadDocument","aoss:WriteDocument"]},{"ResourceType":"collection","Resource":["collection/<collection-name>"],"Permission":["aoss:CreateCollectionItems","aoss:DescribeCollectionItems"]},{"ResourceType":"model","Resource":["model/<collection-name>/*"],"Permission":["aoss:CreateMLResource"]}],"Principal":["<principal_arn>"]}]'Note: AOSS data access policies do not support IAM condition keys. Use network policies (VPC endpoints) and principal scoping for access control.
Tip: Remove permissions not needed for your use case. For read-only collections, remove aoss:WriteDocument, aoss:UpdateIndex, aoss:DeleteIndex.
Choose type based on strategy:
Neural sparse requires SEARCH type, not VECTORSEARCH.
aws opensearchserverless create-collection \
--name <collection-name> \
--type SEARCH \
--description "Search application collection"aws opensearchserverless batch-get-collection --names <collection-name>Typically 1-3 minutes.
Proceed to provisioning-serverless-deploy-search.md.