Netlify is the platform your developers love for building highly-performant and dynamic web sites, e-commerce stores and applications.
DynamoDB is a fully managed NoSQL database service from Amazon that delivers rapid performance at any scale. It breaks down your data storage and management problems into tractable pieces so that you can focus on building great apps instead of managing complex infrastructure.
Want to explore Netlify + Amazon DynamoDB quick connects for faster integration? Here’s our list of the best Netlify + Amazon DynamoDB quick connects.
Explore quick connectsLooking for the Amazon DynamoDB Alternatives? Here is the list of top Amazon DynamoDB Alternatives
It's easy to connect Netlify + Amazon DynamoDB without coding knowledge. Start creating your own business flow.
Triggers when a new deploy of your site has failed.
Triggers when a new deploy of your site has started building.
Triggers when a new version of your site has successfully deployed.
Triggers when a form receives a new submission.
Trigger when new item created in table.
Trigger when new table created.
Performs a new deploy of an existing site.
Creates new item in table.
Create a new item or updates an existing item.
(30 seconds)
(10 seconds)
(30 seconds)
(10 seconds)
(2 minutes)
Netlify is a hosting service for websites. It allows developers to host their site on Netlify servers or deploy it to S3 buckets. Netlify has a lot of great features such as deployment, content management system, custom domain and others.
Amazon DynamoDB is a cloud-based NoSQL database that allows you to store and query data items in tables. DynamoDB uses extremely well-scalable and available web-scale design, which means it can handle large amounts of data with high throughput and low latency at any scale.
Recently, Netlify announced the support of Amazon DynamoDB as a storage backend for Netlify sites. It’s a great opportunity for those who want to use Netlify to host their static website and easily have a global CDN, HTTPS, continuous delivery and other great features. However, they only support one architecture – monpithic. For those who want to use AWS Lambda and run their code on different environments, this integration doesn’t help us. But there is a workaround!
How to do it? The answer is simple – we just need to create a project in Netlify, then download the JSON file with key pair, paste it into AWS and create an API Gateway endpoint. Then we are able to deploy our application with AWS Lambda! It sounds like a complicated process, but it really isn’t. Let’s get started!
First, create an account on Netlify and create a new site. When creating a site, there are two options – static or JAM stack. We’ll choose static site because it doesn’t require coding. You can find static site settings at “Settings” > “Static site” (in the right sidebar. Now we just need to add our files, then we’re ready to deploy! Deployment usually takes 5 minutes, so prepare a cup of coffee or put your feet up while waiting.
After deploying your site, you will see a list of your files. Open the JSON file with key pair under the link “Download public key” and save it somewhere safe. This is what we will use in AWS next.
Now go to AWS Conspe and select “Services” > “API Gateway” > “Create API” > “New API” > “Create New API”:
In the left sidebar go to “API Overview” > “Step 3. Configure Resources” where you need to create two resources – method request and method response. Method Request Resource should be created with POST method. In the “Resource Integration Type” select “AWS Lambda Function – Invoke API Gateway”:
Method Response Resource should also be created with POST method. In the “Resource Integration Type” select “AWS Lambda Function – Invoke API Gateway”:
Click on save button in the top right corner. Now create an API Gateway endpoint in the left sidebar under “API Endpoints” > “Create API Gateway endpoint”:
In the “Name” field type anything you want (for example, netlify. and click on save button in the top right corner. This is how your API Gateway looks like:
Copy your AWS Lambda function code here and click on save button in the top right corner (don’t forget to replace $api_key variable):
{ "name". "netlify", "description". "Netlify integration from AWS", "tags". [], "handlers". { "lambda". { "arn". "arn:aws:lambda:us-east-1:XXXXXX:function:lambda", "rpe". "arn:aws:iam::XXXXXX:rpe/lambda_basic_execution" } }, "lambda". { "handler". "index.lambda_handler", "profile". "default" }, "runtime". "nodejs6.10", "timeout". 30 } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 { "name" . "netlify" , "description" . "Netlify integration from AWS" , "tags" . [ ] , "handlers" . { "lambda" . { "arn" . "arn:aws:lambda:us-east-1:XXXXXX:function:lambda" , "rpe" . "arn:aws:iam::XXXXXX:rpe/lambda_basic_execution" } } , "lambda" . { "handler" . "index.lambda_handler" , "profile" . "default" } , "runtime" . "nodejs6.10" , "timeout" . 30 }
Now open your browser and go to https://api-id.execute-api.netlify.cometlify/. Here you should see the JSON response from your function with your API key inside! It looks something like this:
{ "$schema". "json-schema"", "$content". null } 1 2 3 4 5 6 7 { "$schema" . " json - schema " ", "$content" . null }
Now go back to Netlify and open “Settings” > “Static site” and paste your API key in the textbox under “Custom Domain (optional)” heading (https://api-id.execute-api.netlify.cometlify/):
Now you can see your site deployed! Create your own custom domain (for example, mine is http://www.codingpaysa.com/. and map it to your Netlify subdomain (in my case it is http://codingpaysa-b4051b6de1e9.netlify.com. Also, don’t forget to enable HTTPS if necessary! If you enabled HTTPS you should see green padlock icon next to your URL in Chrome address bar! If everything went well you should see something like this in your conspe:
If you set up CORS correctly then you should see this message in your browser when trying to access the page via HTTP instead of HTTPS:
Boom! Now we have successfully integrated Netlify and Amazon DynamoDB! We have our website hosted using Netlify with a custom domain name, SSL certificate, CDN and other awesome features! It was an easy process so I hope you enjoyed it! Please let me know if something went wrong or if you have any questions about this article! Talk to you soon!
The process to integrate Netlify and Amazon DynamoDB may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.