Connect to Elasticsearch
You can connect to Elasticsearch and make it available as a resource in Retool. Once complete, your users can write queries that interact with Elasticsearch data.
Requirements
All users for Retool organizations on Free or Team plans have global Edit permissions and can add, edit, and remove resources. If your organization manages user permissions for resources, you must be a member of a group with Edit all permissions.
To create a Elasticsearch resource, you need:
- Your Elasticsearch Base URL, which you can find at
https://cloud.elastic.co/deployments/{{your_deployment_id}}
under Copy endpoint. - A username and password for Basic authentication, or an API key, each with read and cluster monitoring privileges.
Allow Retool to access Elasticsearch
If Elasticsearch is behind a firewall, you must allow access from Retool's IP addresses. Add the IP addresses to your firewall's Allowlist before you create the resource.
1. Create a new resource
Sign in to your Retool organization and navigate to the Resources tab. Click Create new, then select Resource.
2. Select the resource type
Retool can connect to almost any API or database, and has built-in integrations for popular data sources. Select the Elasticsearch resource type.
3. Configure the resource
Specify a name and location for the Elasticsearch resource. Retool displays the resource name and type in query editors to help users identify them. Next, configure the required settings.
General
Setting | Description |
---|---|
Base URL | The base URL for your Elastic cluster. |
Enable SSH tunnel | Enable SSH tunneling through bastion host. |
Authentication
You can authenticate into your Elasticsearch cluster with Basic Auth or API Key Auth.
Basic authentication
Setting | Description |
---|---|
Username | The dedicated username. Elastic also provides two default users, elastic and enterprise_search. |
Password | The password for your dedicated user. If you use elastic as your user, you can find this in the credentials-12345-date.csv file, accessible by admins. |
API key authentication
Setting | Description |
---|---|
API Key | The API key. You can create this using the /_security/api_key endpoint in your Elasticsearch cluster. Use the encoded field in the response. |
Click Test Connection to verify that Retool can connect to Elasticsearch. If the test fails, check the resource settings and try again. Testing a connection only checks whether Retool can successfully connect to the resource. It cannot check whether the provided credentials have sufficient privileges or can perform every supported action.
4. Save the resource
Click Create resource to complete the setup. You can then click either Create app to immediately start building a Retool app or Back to resources to return to the list of resources.
Wrap up
Your Elasticsearch resource is now ready to use. To interact with Elasticsearch data, select the resource in the query editor.