An AWS CDK construct library (v0.0.13) for managing OpenSearch REST resources like roles, role mappings, and users via CloudFormation custom resources. Designed for domains with fine-grained access control enabled. It uses the Domain L2 construct and assumes master user credentials are stored in AWS Secrets Manager. Supports role, role mapping, and user resources out of the box with a low-level API for arbitrary REST endpoints. Currently limited to OpenSearch domains in a VPC with specific access policies. This is a relatively early release with infrequent updates; check for breaking changes before upgrading.
npm install opensearch-rest-resourcesNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an OpenSearch role and role mapping using CDK with fine-grained access control.
Upgrade to >=0.0.8 or stick to Role/RoleMapping only.
Ensure your Secrets Manager secret contains keys 'username' and 'password'.
Use the 'removalPolicy' property inherited from ResourceBase.
Check VPC settings and security group rules for the Lambda function created by the construct.
Use unique names for each OpenSearchRole resource, or use the 'roleName' property to reference an existing role.
Review the updated payload structure in the documentation or reference the OpenSearch API.
npm install opensearch-rest-resources and ensure you are in a CDK app directory.
Add 'payload' property with the appropriate JSON structure.
Check that the master user credentials are correct and the payload matches OpenSearch API documentation.
Verify that the Lambda function has network connectivity to the OpenSearch domain, and that the domain's access policy allows the Lambda's source IP or VPC.
Ensure your secret has keys 'username' and 'password'. Set the secret ARN via props or CDK context.