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.


Requirements

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.

Getting the integration

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 Install button, at the bottom-right corner of the page.

A successful message appears to confirm your integration is installed.


Configuring the integration

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 success message indicating that your edge application has been updated.


Instantiating the integration

Still on the Edge Application page:

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

This action will load the Arguments tab, where you can add the parameters to execute your application.

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 success message indicating that your edge application has been updated.


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 success message indicating that your edge application has been updated.


Contributors