How to install Fauna solution from Azion Marketplace
Overview
Fauna is a flexible, developer-friendly, transactional database that comes as a secure and scalable cloud API with native GraphQL. It integrates seamlessly into the serverless ecosystem.
1. Getting the solution
The Fauna solution is a serverless solution available at Azion Marketplace.
To use the Fauna solution, you have to:
- Log in to Real-Time Manager (RTM).
- If you don’t have one yet, create an account visiting the sign-up page.
- On the upper-left corner of the page, select Products menu > Marketplace.
- Select the search box and type “fauna” or browse through the cards to find the Fauna solution.
- Once you’ve found the Fauna card, select it to go to the solution page.
- On the solution page, look for the Subscribe for section on the bottom-right corner and click the Get It Now button.
You’ll see a message indicating that your solution was successfully installed and is ready to use.
2. Creating an account at Fauna
To use the Fauna solution, you’ll need to have an API key. To get it, you have to register at Fauna.
To do so, follow the steps:
- Go to Fauna website registration to create an account.
- After you’ve created your account, go to your dashboard and select Security on the side bar.
- On the security page, generate an API key by clicking on the New Key button.
- Take note of your API key because you can’t retrieve this key later. If you lose the key, you’ll have to revoke the old key and create a new one.
- Give an easy to remember name to your key and click the Save button.
- After clicking the Save button, you’ll see a message showing your secret key.
Done. Now that you have a secret key, you can instantiate your Fauna solution at Azion.
3. Using the solution
Once you’ve gotten your solution on Marketplace, it’ll be available at your edge functions list. To use the solution, you’ll have to create a new edge application.
To create an edge application you have three options:
- By visiting the documentation on getting started.
- Through RTM. On the upper-left corner of the page, select Products menu > Edge Application and follow the instructions.
- Using an already existing edge application.
4. Configuring the solution
To configure your solution, proceed as follows:
- On the upper-left corner, select Products menu > Edge Applications on the BUILD section.
- On the listing page of your edge applications, select the one you want to use with the Fauna solution.
- On the application page, on the Main Settings tab, locate the Edge Functions switch and turn it on to enable functions on your edge application.
- Click the Save button.
You’ll receive a successful message indicating you have updated your edge application.
5. Instantiating the solution
To enable this function, while still on the Edge Application page:
- Select the Functions tab on the top list.
- Click the Add Function button.
- Choose an easy to remember name for your function.
- On the function dropdown menu, select the Fauna function.
This action will load the function, showing a form with the solution source-code and, just above it, two tabs: Code and Args. By clicking on the Code tab you will be able to navigate through the code, but won’t be able to change it.
This function works without configuration on the Args tab. The JSON Args for this functions are parametrizable through the request headers: x-secret
(the key you got on Fauna dashboard) and x-db-name
(name of the database you’re going to create on Fauna).
6. Configuring a rule on Rules Engine
Still in the Edge Application page, in the Rules Engine tab, you have to configure the rules you want (criteria and behavior) to apply to run your function.
To do so, follow these steps:
- Select the Rules Engine tab.
- Click on Default Rule.
- Note: you can’t change the criteria field for the Default Rule on Rules Engine.
- On the behavior field, select Run Function from the dropdown menu and then select the Fauna function, according to the name you gave it in the instantiation step.
- Click the Save button.
—-
Didn’t find what you were looking for? Open a support ticket.