Skip to content

Task 4 dynamodb#2

Merged
erickv99 merged 6 commits intomainfrom
task-4-dynamodb
Apr 4, 2024
Merged

Task 4 dynamodb#2
erickv99 merged 6 commits intomainfrom
task-4-dynamodb

Conversation

@erickv99
Copy link
Copy Markdown
Owner

@erickv99 erickv99 commented Apr 2, 2024

Task 4.1

Inside /seed folder

products.sh
stocks.sh

Task 4.2

apis

products

https://ej64rpzdqi.execute-api.us-east-1.amazonaws.com/dev/products

products by id

https://ej64rpzdqi.execute-api.us-east-1.amazonaws.com/dev/products/{id}

https://ej64rpzdqi.execute-api.us-east-1.amazonaws.com/dev/products/18b3113a8-b9a3-48e4-83fd-b14ed7305c0a

Here is the FE calling the API with dynamo db integrated

https://d1gsz2pixpaq08.cloudfront.net

Task 4.3

The following command can be used to test the createProduct function locally

sls invoke local -f createProduct --data '{"headers":{"Content Type": "application/json"},"body": {"title":"Chair", "description":"good chair", "price": 100, "count":10}}'

Additional (optional) tasks

  • +6 (All languages) - POST /products lambda functions returns error 400 status code if product data is invalid
image
  • +6 (All languages) - All lambdas return error 500 status code on any error (DB connection, any unhandled error in code)

  • +6 (All languages) - All lambdas do console.log for each incoming requests and their arguments

image
  • +6 (All languages) - Use RDS instance instead fo DynamoDB tables. Do not commit your environment variables in serverless.yml to github!

  • +6 (All languages) - Transaction based creation of product (in case stock creation is failed then related to this stock product is not created and not ready to be used by the end user and vice versa)

@erickv99 erickv99 merged commit 9f26da3 into main Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant