Code Monkey home page Code Monkey logo

aws-lambda-java-dynamodb-enhanced-client-microservice's Introduction

AWS-Lambda-java-DynamoDB-enhanced-client-microservice

The project was built to explore the new DynamoDB Enhanced Client.
Conceptually a user can manage "memoryCards" (things he wants to learn and remember) using this service.

Architecture

This project contains multiple lambda functions that each execute an other operation on DynamoDB.
They all use the new DynamoDB Enhanced Client to execute the operations.
The project was built to explore the new DynamoDB Enhanced Client.

Operations:

  • putItem: create a new item
  • query by partitionKey and a condition on the sort key
  • query on a GSI
  • full table scan
  • deleteItem

Architecture

Build and deploy

Prerequisits:

  • Gradle or gradle wraper
  • Java11

Build and deploy:

  • build: ./gradlew clean build
  • deploy first time: sam deploy --guided
  • deploy: sam deploy
  • build and deploy. After deploying for the first time you can build and deploy wit using the build-and-deploy.sh script.
  • delete the stack: aws cloudformation delete-stack --stack-name {{name-of-your-stack}}

OUTPUTS: The stack will output the baseURL for the application on which you can execute requests.

Deploying in a region other than us-east-1: in template.yml uncomment the env variables for REGION and set it your region.

Playing with the application

Once deployed copy the ApiGateway url and start sending requests to it. You can post a basic "memoryCard" that looks like this:

{
  "author": "nick",
  "memoryText": "Use the new DynamoDB enhanced client",
  "category": "cloud"
}

This will then be saved in the database.
You can create more memoryCards.
Or you can delete, getOne, getAll.
These endpoints will all trigger different operations on DynamoDB using the enhanced-client for DynamoDB.

Intellij Http If you are using IntelliJ you can use the Http Requests in the http folder to trigger the endpoints.

  • Update the URL in http-client.env.json to your own URL. You can get this from the outputs of the stack.
  • run all requests in api.http using the test environment

Contact

Feel free to raise issues, PR's or reach out via Twitter: https://twitter.com/thenickvanhoof

aws-lambda-java-dynamodb-enhanced-client-microservice's People

Contributors

nxtra avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.