This is a monorepo for AWS API provisioning for the Danny drumsticks store
authorization-service
creationλ basicAuthorizer
- specify .env authentication parameters
- Basic auth flow
- 401 - for header absence, 403 - for improper authentication details
/import
updated with Gateway authorizerbasicAuthorizer
is used as an authorizer
- FE application sends the authorization token
- the token is taken from the local storage
PR
λ catalogBatchProcess
batching new products records- SQS queue created
batchSize: 5
- lambda iteration over SQS records
λ importFileParser
lambda to post messages to SQS- no Readable stream
- SNS Topic creation
- subsctiption to the topic with an email receiver
- updated
λ catalogBatchProcess
to push messages
PR
- +15
done
- catalogBatchProcess lambda is covered by unit tests - +15
done
- set a Filter Policy for SNS createProductTopic in serverless.yml and create an additional email subscription to distribute messages to different emails depending on the filter for any product attribute
import-service
created- new S3 bucket with the
/uploaded
folder created
λ importProductsFile
created/imoprt
url- signed url generation
- name of the file in query parameters
- serverless configured
- response as a signed url
- FE integration
λ importFileParser
- s3 event
s3:ObjectCreated:*
configured - event restrictions for only
uploaded
folder csv-parser
reading readable stream
PR
- +10
done
- async/await is used in lambda functions - +10
done
- importProductsFile lambda is covered by unit tests. (for JS only) aws-sdk-mock can be used to mock S3 methods - +10
done
- At the end of the stream the lambda function should move the file from the uploaded folder into the parsed folder (move the file means that file should be copied into a new folder in the same bucket called parsed, and then deleted from uploaded folder)
Products
andStocks
DynamoDb tables've been created- The fill script for data generation from mocks
- serverless.ts is extended with iam role creation for dynamodb access and with environment variables storing the region, products and stocks tables
λ getProductsList
returns joined response from Stocks and Products tablesλ getProductsById
returns joined respoins from a product and the respective stockλ getProductsById
integrated with/products/{id}
λ createProduct
created/products
POST endpoint- business-logic created to post a new product and the according stock
- the URL added to the links section /products POST
PR
- +6
done
- POST /products lambda functions returns error 400 status code if product data is invalid - +6
done
- All lambdas return error 500 status code on any error (DB connection, any unhandled error in code) - +6
done
- All lambdas do console.log for each incoming requests and their arguments - +6
done
- Use RDS instance instead fo DynamoDB tables. Do not commit your environment variables in serverless.yml to github! - +6
done
- 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)
The procuct-service
's been created through the aws-nodejs-typescript
template in the services monorepo.
getProductsList
lambda function created.- request url -
/products
, method -GET
- returns full array of mocked yet products which are drumsticks.
- the endpoint is integrated into the FE application of the drumsticks store on the products list page.
getProductsById
lambda function created.- request url -
/products/{id}
, method -GET
, search by product id - the search is conducted through the list of products returned from the array of products
- the endpoint is not integrated into the FE app
- task_3 branch created
- pull request created
- request submitted
- +5 -
done
Async/await is used in lambda functions - +5 -
done
Async/await is used in lambda functions ES6 modules are used for Product Service implementation - +4 -
done
Custom Webpack/ESBuild/etc is manually configured for Product Service. Not applicable for preconfigured/built-in bundlers that come with templates, plugins, etc. - +4 (All languages) -
done
- SWAGGER documentation is created for Product Service - +4 (All languages) -
done
- Lambda handlers are covered by basic UNIT tests (NO infrastructure logic is needed to be covered) - +4 (All languages) -
done
- Lambda handlers (getProductsList, getProductsById) code is written not in 1 single module (file) and separated in codebase. - +4 (All languages) -
done
- Main error scenarios are handled by API ("Product not found" error).