add-endpoint

Summary

Adds a connection endpoint for Fauna.

fauna add-endpoint ENDPOINT [--alias=endpoint alias] [--key=secret]

Description

The add-endpoint command adds a connection endpoint 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, it is recommended that you use the cloud-login command instead of add-endpoint. cloud-login guides you through selecting the correct Region Group to connect to. If you need to connect to Fauna’s Preview environment, or another non-standard endpoint, continue to use add-endpoint.

Arguments

Argument Description

ENDPOINT

The URL of the endpoint that you want to add.

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

Since the introduction of Region Groups, three cloud URLs are available. You do not need to specify these URLs, but they work when you do:

Classic (US and EU): https://db.fauna.com:443

United States (US): https://db.us.fauna.com:443

Europe (EU): https://db.eu.fauna.com:443

Preview: https://db.fauna-preview.com:443

Options

Option Description

--alias=<endpoint alias>

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

--key=<secret>

Optional - The secret associated with a specific database at the endpoint, that provides the authentication to run queries in Fauna.

Examples

The following example demonstrates adding a new endpoint. Since the --alias and --key options were not specified, 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 automatically creates the configuration file.

To see the configuration file, perform one of these steps:

  1. On Linux, macOS, and other Unix-like operating systems, run the following command in a terminal:

    cat $HOME/.fauna-shell
  2. On Windows, run the following command in a command terminal:

    type %userprofile%\.fauna-shell

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!