Writing to DynamoDb via API (in progress)

We can already read - may as well write

Writing to DynamoDb via API (in progress)

Just getting rolling on this one.

Reference the “How to Read from a DynamoDb” (here) to see how my table is set up.

  1.  Create a new API

  2. Create a Lambda Function
    1. Choose “Author from scratch”
    2. Runtime – choose “Python”.
    3. Enter a role that has admin rights.

    4. Create the first iteration of the lambda function.  If you click “Test” you should get a positive message.

  3. Go back to your Resources and create a method
    1. Choose type “Post”
    2. Enter the Lambda function you created in previous step

    3. Click on “Test” to test the Post.
      1. In the “Request Body” add the following:

      2. click “Test”.  You should see something like this:

    4. Update the Lambda function to perform persist data to Lambda
      1. See boto 3 documentation here.
      2. Update the function to write to the existing table:

      3. Use “Action” – “Deploy” to deploy it to production.

 

 

 

Tags
, ,

Add a comment

*Please complete all fields correctly

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Blogs