aws-doc-sdk-examples icon indicating copy to clipboard operation
aws-doc-sdk-examples copied to clipboard

EPIC: Serverless Aurora app (Cross-services)

Open brmur opened this issue 2 years ago • 0 comments

Create the backend for the Serverless_Aurora_app in your AWS SDK programming language(s).

Use the following pre-created resources

  • React Front-end
  • Amazon Cloud Formation Script for scaffolding resources
  • README (you can copy the instructions from the existing Readme for front end instructions.)

User stories

The requirement here is to write a Rest API backend in your AWS SDK language that a React app can use by sending Restful requests. The backend must use the RdsDataClient to perform CRUD operations on the Serverless Amazon Aurora RDS Work table.

The Rest API backend supports these operations:

A method to query active items A method to query archive items A method to update the Work table by updating an item from active to archive. A send report operation that queries active items, creates a report (this can be a text file, an excel file, etc) and uses SES to email a recipient.

Therefore the Restful API exposes these endpoints:

GET /items/<state>

Retrieves a list of work items with the specified state from the endpoint.

  • state can be either active or archive.
  • Items are expected to be a JSON array of items that each have the following fields:
    [{
      "id": "<item ID>",
      "name": "<user name>",
      "guide": "<guide name>",
      "description": "<item description>",
      "status": "<item status>"
    }, {
      ...more items...
    }]

POST /items

Adds a work item to the list.

  • The body of the request is a single item in JSON format.
    {
      "name": "<user name>",
      "guide": "<guide name>",
      "description": "<item description>",
      "status": "<item status>"
    }

PUT /items/<itemId>

Archives an active work item.

  • itemId is the ID of the item to archive.

POST /report

Sends an email report of work items.

  • The body of the request is a single item in JSON format.
    {"email": "<recipient's email address>"}

To see a live example of /api/archive, see: http://rdsitemtracker-env.eba-aqmhsdtk.us-west-2.elasticbeanstalk.com/api/archive (open in Firefox to see well formatted JSON)

To see Java code that you can use an example of how to use the RDSDataClient, see this Private Github Readme (ignore the name of file and if you do not have permission, let Scott know).

https://github.com/scmacdon/KotlinCode/tree/main/usecases/creating_workflows_stepfunctions

  • [ ] C++ - Serverless Aurora app
  • [ ] Go - Serverless Aurora app
  • [x] Java - Serverless Aurora app
  • [ ] JavaScript - Serverless Aurora app
  • [x] Kotlin - Serverless Aurora app
  • [ ] .NET- Serverless Aurora app
  • [x] #3282
  • [x] #3220
  • [ ] Rust - Serverless Aurora app
  • [ ] Ruby - Serverless Aurora app
  • [ ] Swift - Serverless Aurora app

brmur avatar Apr 21 '22 15:04 brmur