FQL v4 will be decommissioned on June 30, 2025. Ensure that you complete your migration from FQL v4 to FQL v10 by that date.

For more details, see the v4 EOL announcement and migration guide. Contact support@fauna.com with any questions.

add-endpoint

Add a connection endpoint for Fauna.

Syntax

fauna add-endpoint ENDPOINT_URL [OPTIONS]

Description

The add-endpoint command adds a connection ENDPOINT_URL for Fauna to the fauna-shell configuration file. If you don’t specify a key or alias, fauna-shell prompts you for them and then writes them to the fauna-shell configuration file.

For most cases, use the cloud-login command instead of add-endpoint. cloud-login guides you through selecting the correct Region Group to connect to. If you want to connect to the Fauna Preview environment, or another non-standard endpoint, continue to use add-endpoint.

Arguments

Argument Description

ENDPOINT_URL

The URL of the endpoint that you want to add.

fauna-shell identifies the URL scheme, domain, and port, and includes those values in the new endpoint entry that it creates in the configuration file.

Options

Option Description

--alias=<endpoint alias>

Optional endpoint alias, a name that identifies a particular endpoint.

--key=<secret>

Optional secret associated with a database at the endpoint. This secret provides the authentication to run queries in Fauna.

--domain=<domain>

Optional Fauna server domain, that is, the hostname where Fauna is running. Defaults to db.fauna.com.

--endpoint=<name>

Optional name of the endpoint to use for the command.

--port=<number>

Optional connection port. Defaults to 8443.

--scheme=<scheme>

Optional connection scheme. Must be one of https or http. Defaults to https.

--secret=<secret>

Optional secret to use. A secret authenticates your connection to Fauna, and connects you to a database.

--timeout=<integer>

Optional connection timeout, an integer number of milliseconds. When the interval has elapsed, fauna-shell stops waiting for a response and displays an error.

The default is zero, which means that fauna-shell waits until a response is received.

Examples

The following example demonstrates adding a new endpoint. Because the --alias and --key options were not given, fauna-shell prompts you for them:

$ fauna add-endpoint https://db.fauna.com:8443
Endpoint Key: ******
Endpoint Alias [db.fauna.com]: db2
Endpoint 'db2' saved.

When the fauna-shell configuration file does not exist, running fauna add-endpoint creates the configuration file. The configuration file should resemble:

default=db2

[db2]
domain=private.example
port=8443
scheme=https
secret=MY_ORGANIZATION_SECRET

When you run the add-endpoint command again, the new endpoint is added to the configuration file:

$ fauna add-endpoint http://localhost:8443/ --alias=localhost --key=secret
Endpoint 'localhost' saved.
default=db2

[db2]
domain=private.example
port=8443
scheme=https
secret=MY_ORGANIZATION_SECRET

[localhost]
domain=127.0.0.1
port=8443
scheme=http
secret=secret

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!