Skip to content

Task5#1

Open
Ajay-Nallanagula wants to merge 4 commits into
mainfrom
task5
Open

Task5#1
Ajay-Nallanagula wants to merge 4 commits into
mainfrom
task5

Conversation

@Ajay-Nallanagula

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

Copy link
Copy Markdown
Owner

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 = () => {

Copy link
Copy Markdown

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
Copy Markdown
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