Skip to content

Conversation

Ajay-Nallanagula
Copy link
Owner

@Ajay-Nallanagula Ajay-Nallanagula commented Jul 29, 2022

Task 5.1, 5.2, 5.3 . All three tasks done.

Used Async Await,
Did Copy and delete S3 Bucket Object Operations
Did not write test cases

Import Url : https://esauexgjw6.execute-api.ap-south-1.amazonaws.com/dev/import?name=<file_name>
PFB Sample PreSigned Url:
image

Frontend PR : Ajay-Nallanagula/nodejs-aws-fe#5

Frontend UI : https://d1zw82pbwmw3ax.cloudfront.net/

NOTE: Plz check the API Calls , using Developer tools. PFB the screenshots.

image

import * as AWS from "aws-sdk";
const csv = require("csv-parser");

const getS3BucketInstance = () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You loose in performance as well as money when you create new Sdk Client for every new function.
Better reuse this logic by defining all the clients beforehand.

https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html
Take advantage of execution environment reuse to improve the performance of your function. Initialize SDK clients and database connections outside of the function handler, and cache static assets locally in the /tmp directory. Subsequent invocations processed by the same instance of your function can reuse these resources. This saves cost by reducing function run time.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change this.

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.

2 participants