Skip to content

Commit dd6c546

Browse files
committed
[CLIENT] Add documentation for creating client with cloud_id
1 parent c3ec800 commit dd6c546

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

elasticsearch-transport/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,17 @@ Another way to configure the URL(s) is to export the `ELASTICSEARCH_URL` variabl
106106
The client will automatically round-robin across the hosts
107107
(unless you select or implement a different [connection selector](#connection-selector)).
108108

109+
### Connect using an Elastic Cloud ID
110+
111+
If you are using [Elastic Cloud](https://www.elastic.co/cloud), you can provide your cloud id to the client.
112+
You must supply your username and password separately, and optionally a port. If no port is supplied,
113+
port 9243 will be used.
114+
115+
Note: Do not enable sniffing when using Elastic Cloud. The nodes are behind a load balancer so
116+
Elastic Cloud will take care of everything for you.
117+
118+
Elasticsearch::Client.new(cloud_id: 'name:bG9jYWxob3N0JGFiY2QkZWZnaA==', user: 'elastic', password: 'changeme')
119+
109120
### Authentication
110121

111122
You can pass the authentication credentials, scheme and port in the host configuration hash:

0 commit comments

Comments
 (0)