Find your connection details
Elastic Stack Serverless
To connect to your Elasticsearch deployment, you need either a Cloud ID or an Elasticsearch endpoint, depending on the deployment type you use. For secure connections, it’s recommended to use an API key for authentication.
- Learn how to find your Cloud ID for Elastic Cloud or self-hosted deployments.
- Learn how to create an API key for Elastic Cloud or self-hosted deployments.
- Learn how to find your Elasticsearch endpoint or Cloud ID for a serverless deployment.
- Learn how to create an API key for a serverless deployment.
Navigate to the Elastic Cloud home page.
In the main menu, click Manage this deployment.
The Cloud ID is displayed on the right side of the page.
To navigate to API keys, use the global search bar.
Click Create API key.
Enter the API key details, and click Create API key.
Copy and securely store the API key, as it will not be shown again.
Navigate to the serverless project’s home page.
Scroll down to the Copy your connection details section, and copy the Elasticsearch endpoint.
The Cloud ID is also displayed in the Copy your connection details section, which you can use with specific client libraries and connectors.
Navigate to the serverless project’s home page.
Scroll down to the Add an API Key section, and click New.
Enter the API key details, and click Create API key.
Copy and securely store the API key, as it will not be shown again.
Use curl
to verify your connection to Elasticsearch.
curl
will need access to your Elasticsearch endpoint and encoded
API key. Within your terminal, assign these values to the ES_URL
and API_KEY
environment variables.
For example:
export ES_URL="https://dda7de7f1d264286a8fc9741c7741690.es.us-east-1.aws.elastic.cloud:443"
export API_KEY="ZFZRbF9Jb0JDMEoxaVhoR2pSa3Q6dExwdmJSaldRTHFXWEp4TFFlR19Hdw=="
Then run the following command to test your connection:
curl "${ES_URL}" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "Content-Type: application/json"
You should receive a response similar to the following:
{
"name" : "serverless",
"cluster_name" : "dda7de7f1d264286a8fc9741c7741690",
"cluster_uuid" : "ws0IbTBUQfigmYAVMztkZQ",
"version" : { ... },
"tagline" : "You Know, for Search"
}
Now you’re ready to start adding data to your Elasticsearch Serverless project.