How to install the Fauna integration through Azion Marketplace

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.

To use the Fauna integration, you must:

  1. Create a Fauna account.
  2. Generate a Fauna API key.
    • To do so, go to your Fauna dashboard and select Security on the side bar. Then, generate an API key by clicking on the New Key button, give it a name, and click the Save 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.
  3. Have an existent edge application on Azion.

To install it:

  1. Access Azion Console > Marketplace.
  2. On the Marketplace homepage, select the integration’s card.
  3. Once the integration’s page opens, click the Get It Now button, at the bottom-right corner of the page.

A successful message appears to confirm your integration is installed.

To configure your integration, proceed as follows:

  1. On the upper-left corner, open the Products menu > select Edge Applications on the BUILD section.
  2. On the listing page of your edge applications, select the one you want to use with the Fauna integration.
  3. On the application page, open the Main Settings tab.
  4. Enable the Edge Functions switch to activate this module on your edge application.
  5. Click the Save button.

You’ll receive a successful message indicating you’ve updated your edge application.

Still on the Edge Application page:

  1. Select the Functions tab.
  2. Click the Add Function button.
  3. Choose an easy to remember name for your function.
  4. On the function dropdown menu, select the Fauna function.

This action will load the function, showing a form with the integration source code and, just above it, two tabs: Code and Args. By clicking the Code tab you’ll 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 function 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).

  1. When you’re ready, click the Save button.

You’ll receive a successful message indicating your function was saved.

Configuring a rule on Rules Engine

Section titled Configuring a rule on Rules Engine

Now you have to configure the rules you want (criteria and behavior) to apply to run your function.

Still on the Edge Application page, follow these steps:

  1. Select the Rules Engine tab.
  2. Click on Default Rule.
    • You can’t change the criteria field for the Default Rule on Rules Engine.
  3. 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.
  4. Click the Save button.

You’ll receive a successful message indicating you’ve updated your edge application.