Build DynamoDB using Handel
DynamoDB is a database provided by Amazon Web Services. It is a NoSQL database. NoSQL databases are built for specific data models. One main features of DynamoDB is its key, which is the only way to access your data. The key is something unique that all your data is going to have, so we are going to use the BYU ID.
Luckily for us, Handel is going to do most of the heavy lifting with permissions and such so that our job is a lot easier. Our beanstalk is going to depend on the database, so that should be the first thing we tell Handel. We will name the database “db”.
In your handel.yml file, add the following dependency directly under your auto_scaling. It should match the image below:
Nice, now let’s set up “db”
Commit, add, and push the changes to GitHub.
Wait for it to deploy on CodePipeline.
If it works, great! Let’s go check it out! Log into AWS, but use the byu-org-trn account.
Click services and select “DynamoBD”.
In the top left hand corner, navigate to “Tables”.
Search for your table (its name is generated by Handel, but it should contain your first and last name).
Look around. Your table won’t have much yet, but it is cool to look at. Let’s move on to writing our controllers so that they can access the database!