This repository contains a way to replicate MongoDB Data API in your respective cloud (AWS, GCP and Azure).
This project leverages the Serverless Application Model (SAM) to create an alternative to the Python MongoDB Data API. It utilizes AWS Lambda for serverless functions and API Gateway for handling interactions. With this setup, you can seamlessly query your existing MongoDB Atlas Cluster using a connection string, just like you would with the MongoDB Data API.
The primary functionalities of this project include all the operations that you would do with the Data API:
- findOne
- find
- insertOne
- insertMany
- updateOne
- updateMany
- deleteOne
- deleteMany
- aggregate
In AWS, we have published a serverless application that will help you deploy a stack required to replicate Data API services in your environments.
- In your AWS account, go the Lambda console. Click on the Applications section present on the right
- Click on Create Application present on the top right.
- Select Serverless application
- Search for MongoDB-DataAPI in the search bar and check the box that says Show apps that create custom IAM roles or resource policies. Select the application highlighted.
- Enter the name of the application, your MongoDB Atlas Cluster Connection Endpoint, check the acknowledgement box and click on Deploy.
After you click on Deploy, AWS will initiate a cloudformation stack which will deploy the following resources for you:
- An HTTP API Gateway with IAM auth enabled
- Custom IAM role that will provide API gateway the required access to invoke the Lambda function
- A Lambda function that will act as a data resolver for your MongoDB Atlas Cluster