Accessing OpenSearch from an application outside Nais ΒΆ

This guide will show you how to access an OpenSearch instance from an application outside of supported Nais clusters.

Enable access to the relevant instance in your manifest ΒΆ

.nais/aivenapp.yaml

yaml

Info

The secretName must be a valid DNS label, and must be unique within the namespace.

Info

The instance name follows the convention opensearch-<team>-<instance>. If you created your instance through Nais Console, use the full name including the opensearch-<team>- prefix.

The access field defines the access level your application will have to the OpenSearch instance. See the available access levels in the reference.

Apply the AivenApplication ΒΆ

Add the file to your application repository, alongside nais.yaml to deploy with Nais github action.

bash

Extract the value of the generated secret ΒΆ

bash

Make the values available to your application.

The secret contains the same environment variables as described in the OpenSearch reference.