- The task is a continuation of Homework 5 and should be done in the same repo
- Task goal is to create a service to be able to save products which were provided in csv file in database.
Find the entire program architecture: here.
- Create a lambda function called
catalogBatchProcess
under the same Serverless config file (i.e.serverless.yaml
) of the Product Service which will be triggered by an SQS event. - Create an SQS queue called
catalogItemsQueue
, in the resources section of the sameserverless.yml
file. - Configure the SQS to trigger lambda
catalogBatchProcess
with 5 messages at once viabatchSize
property. - The lambda function should iterate over all SQS messages and create corresponding products in the products table.
- Update the
importFileParser
lambda function in the Import Service to send each CSV record into SQS. - It should no longer log entries from the readable stream to CloudWatch.
- Create an SNS topic
createProductTopic
and email subscription in the resources section inserverless.yml
of the Product Service. - Create a subscription for this SNS topic with an
email
endpoint type with your own email in there. - Update the
catalogBatchProcess
lambda function in the Product Service to send an event to the SNS topic once it creates products.
- Commit all your work to separate branch (e.g.
task-6
from the latestmaster
) in your own repository. - Create a pull request to the
master
branch. - Submit the link to the pull request for crosscheck
Reviewers should verify the lambda functions, SQS and SNS topic and subscription in PR.
- File
serverless.yml
contains configuration forcatalogBatchProcess
function - File
serverless.yml
contains policies to allow lambdacatalogBatchProcess
function to interact with SNS and SQS - File
serverless.yml
contains configuration for SQScatalogItemsQueue
- File
serverless.yml
contains configuration for SNS TopiccreateProductTopic
and email subscription
- +15 (All languages) -
catalogBatchProcess
lambda is covered by unit tests - +15 (All languages) - set a Filter Policy for SNS
createProductTopic
inserverless.yml
and create an additional email subscription to distribute messages to different emails depending on the filter for any product attribute
The follwoing should be present in PR's description field:
-
What was done?
Example:
Service is done, but FE is not working...
Additional scope - webpack, swagger, unit tests
-
Link to Product Service and Import Service APIs - .....
-
Link to FE PR (YOUR OWN REPOSITORY) - ...
-
In case SWAGGER file is not provided - please provide product schema in PR description