Skip to content
This repository was archived by the owner on Jul 15, 2024. It is now read-only.

fauna-labs/aws-http-api

Repository files navigation

This repository contains unofficial patterns, sample code, or tools to help developers build more effectively with Fauna. All Fauna Labs repositories are provided “as-is” and without support. By using this repository or its contents, you agree that this repository may never be officially supported and moved to the Fauna organization.

Building a serverless REST API with AWS SAM and Fauna

This repository contains the source code referenced in the blog post Building a serverless REST API with AWS SAM and Fauna.

Pre-requisites

To deploy this application you must have access to a Fauna account and an AWS account. You can register for a free Fauna account and benefit from Fauna’s free tier while you learn and build. You do not need to provide payment information until you upgrade your plan.

You can sign up for an AWS account by following these instructions. Although you must provide a payment method to create an AWS account, AWS also offers a free tier.

To deploy this application from the command line, you must install and configure the AWS Command Line Interface (CLI) and the AWS Serverless Application Model (AWS SAM) CLI.

To deploy this repository using a quick-create CloudFormation stack, please see the original blog post.

Deploying with AWS SAM CLI

First, complete the steps Configuring a database in Fauna and Storing secrets in Parameter Store from the original blog post.

Next, clone this repository to your local machine:

git clone https://github.com/fauna-labs/aws-http-api.git
cd aws-http-api

Use AWS SAM CLI's guided interactive deployment mode to deploy the application to your AWS account.

sam build && sam deploy --guided

Note: You can accept most of the defaults, but you must explicitly choose "y" to each question {FunctionName} may not have authorization defined, Is this okay?

After the deployment completes, copy the value of the ListStoresURL output and open the URL in a new browser tab. You should receive a JSON object containing a list of stores from the sample data in your Fauna database!

Cleaning up resources

Once you complete this tutorial, you may wish to remove the resources you create to avoid unexpected charges. Complete the step Cleaning up resources in the original blog post to remove all resources related to this repository from your Fauna and AWS accounts.


Copyright Fauna, Inc. or its affiliates. All rights reserved. SPDX-License-Identifier: MIT-0

About

Repository for the blog post "Building a serverless REST API with AWS SAM and Fauna"

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •