cloud-login command creates a Fauna endpoint in the
configuration file based on your Fauna credentials.
cloud-login command prompts you for your Fauna credentials, and
if you authenticate successfully, creates a
cloud endpoint in the
configuration file that you can use
to query your top-level Fauna database.
There are several prompts that help you to create endpoints that work with Region Groups, GitHub and Netlify authentication, or secrets for existing databases:
Endpoint alias prefix: Since the introduction of Region Groups, you might need to access databases in multiple Region Groups. This prompt asks you for a prefix that can be applied to multiple Region Group endpoints.
For example, entering
cloudas the prefix (which is the default) could result in the endpoints:
cloud-us: This represents the US Region Group that replicates data within the continental United States.
cloud-eu: This represents the EU Region Group that replicates data within Europe.
How do you prefer to authenticate?: This prompt asks you for your authentication preference:
Email and Password: You can use your Fauna Dashboard credentials to authenticate.
When you choose this option, you are then asked for your email address and password.
Secret: You can use a secret for an existing database, similar to how your client applications would authenticate.
When you choose this option, you are then asked for a secret, which is the authentication bearer token acquired by creating a key or token.
You are then asked which Region Group to connect to, EU, or US. The secret is associated with a specific database in a specific region: if you choose incorrectly, a "could not connect" error appears and you are prompted for your secret again.
Multi-factor authentication: When multi-factor authentication (MFA) is enabled for your account in the Dashboard, the
cloud-loginfunction prompts you for the current (time-based) multi-factor authentication code — you can see the current code in your authenticator app. If you do not enter the correct code,
cloud-loginexits with an error. Note that this does not occur when you authenticate using a secret.
Default endpoint: When your
fauna-shellconfiguration file contains an existing endpoint, you are asked whether the new endpoint that
cloud-logincreates should be made the default.
The following example demonstrates the use of
cloud-login, and the
prompts for email/secret and password:
fauna cloud-login ? The endpoint alias prefix (to combine with a region): cloud ? How do you prefer to authenticate? Email and Password ? Email address: email@example.com ? Password: [hidden] ? Enter your multi-factor authentication code 377277 ? Endpoints created. Would you like to set one of them as default? Keep 'cloud' endpoint as default Endpoint 'cloud' set as default endpoint.
After a successful login, your
configuration file now contains a
cloud endpoint that includes the secret to access your top-level
To see the configuration file, perform one of these steps:
On Linux, macOS, and other Unix-like operating systems, run the following command in a terminal:
On Windows, run the following command in a command terminal:
The configuration file should resemble:
default=cloud [cloud] domain=db.fauna.com scheme=https secret=fnADS@PxN@2CE@n7z@kDa4_p6Z@fIBaZm@Qt@bYT graphqlHost=graphql.fauna.com
Every secret provided by Fauna is unique, so the secret you see
when you run
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums or email firstname.lastname@example.org
Thank you for your feedback!