---
# System prepended metadata

title: Connect an application using serverless framework to an existing DynamoDB
tags: [self-taught, published, blog]

---

Connect an application using serverless framework to an existing DynamoDB
===

**Few things we need to know before we start:**
- Serverless framework is a framework that helps develop, deploy, troubleshoot and secure your serverless applications and provide you with full serverless application lifecycle management. It works with many different cloud provider like AWS, Azure, Alibaba Cloud, … and very easy to install with multiple options for you to start with.
https://www.serverless.com/framework/docs/providers/aws/guide/installation
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j0iqip511rxausobfj60.png)
 
- DynamboDB is a NoSQL Database and is on of the Amazon Web Services.

**Now**, I assumed that you have your serveless app ready and connected to AWS provider. So, let’s get to the main part.
The file that manage connection between your serverless app and the database is `serverless.yml` . When you install the serverless framework, it probably have `yml` file ready to help you create table once you run your application.
If you want to connect your app to existing DB that you’ve created, first thing to do is comment out or remove below part:

![Basic info to create table, just the same as when you create directly from DynamoDB Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ru7jnefshqvccdb48gje.png)

Then, adjust the provider part as below. `The Resource:` part is like a place where you define the address of your database. There’re serveral way to define this, either you put it in .env to make it secured or just put directly as below screenshot, becasue even if people see that address below, they still need your account to be able to access the db.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5zd3plu9jy5wya86vt14.png)

To find this arn, go to your table details in DynamoDB and copy the `Amazon Resource Name (ARN)` . And voila, now try to test your api to add or edit the item in your table.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yriktpt77f3igwmmxlnd.png)

Although it seems extremely easy, if you’ve just started with Amazon services like i do, it’d take tons of time. So, i hope this helps. 

<small>
    Published date: 2021-10-04 <br/>
    Also published <a href="https://medium.com/goalist-blog/connect-an-application-using-serverless-framework-to-an-existing-dynamodb-e225f67ffdf4">here</a>.
</small>