Questions tagged [aws-sdk-nodejs]

AWS SDK for JavaScript enables Node.JS developers to easily work with Amazon Web Services

The AWS SDK for JavaScript enables Node.JS developers to easily work with Amazon Web Services and build scalable solutions with Amazon S3, Amazon DynamoDB, Amazon Glacier, and more.

Getting Started

User Guide

API Documentation

519 questions
15
votes
1 answer

AWS S3 SDK V3 for Node.js - GetObjectCommand v/s getSignedUrl

I'm building a web app in which I need to let users upload documents to their account and also read all the documents they have uploaded. In addition, I would like to allow users to be able to upload a profile photo as well. To handle file storage,…
raghav
  • 225
  • 1
  • 2
  • 9
13
votes
3 answers

aws sdk Multipart Upload to s3 with node.js

I am trying to upload large files to a s3 bucket using the node.js aws-sdk. the V2 method upload integrally uploads the files in a multipart upload. I want to use the new V3 aws-sdk. What is the way to upload large files in the new version? The…
11
votes
5 answers

Error: Cannot find module '@aws-sdk/client-sns'

I am getting this error when calling my lambda. "errorType": "Runtime.ImportModuleError", "errorMessage": "Error: Cannot find module '@aws-sdk/client-sns'\nRequire stack:\n- /var/task/handler.js\n- /var/runtime/UserFunction.js\n-…
rahul sharma
  • 304
  • 1
  • 2
  • 12
11
votes
1 answer

What is the maximum outbound connections I can create from AWS Lambda?

I am looking at the documentation on Lamba Limits which says: Number of file descriptors 1,024 I am wondering if this is per invoking lambda or total across all lambdas? I am processing a very large number of items from a kinesis stream and I…
justin.m.chase
  • 13,061
  • 8
  • 52
  • 100
11
votes
2 answers

AWS Lambda function write to DynamoDB

I'm a beginner with Amazon Web Services and NodeJS. I wrote a Lambda function, triggered by AWS IoT, that parse a JSON. enter code here use strict'; console.log('Loading function'); exports.handler = (event, context, callback) => { …
Federico
  • 1,117
  • 6
  • 20
  • 37
11
votes
2 answers

How to Add API Key to Usage Plan in AWS API Getaway

I have a problem with creating API Key associated with an Usage Plan in AWS API Getaway (using AWS SDK for node.js). In AWS Console you can attach API Key to Usage Plan via this button: However I could not find a similar function in AWS SDK…
bpavlov
  • 1,080
  • 12
  • 32
10
votes
5 answers

AWS Textract StartDocumentAnalysis function not publishing a message to the SNS Topic

I am working with AWS Textract and I want to analyze a multipage document, therefore I have to use the async options, so I first used startDocumentAnalysisfunction and I got a JobId as the return, But it needs to trigger a function that I have set…
9
votes
7 answers

Mock the constructor for AWS.DynamoDB.DocumentClient using jest

I have a function that looks like this: function connect() { const secret = 'secret'; const key = 'key'; const region = 'region'; const client = new AWS.DynamoDB({ secret, key, region });' return new…
vamsiampolu
  • 6,328
  • 19
  • 82
  • 183
9
votes
2 answers

Using batchWriteItem in dynamodb

I have two tables in my dynamo db one is candidate table and the other one is user table I want to use batchWriteItem in dynamo db in order to add the data in the table. The query which I have formatted is as follows var user = { userid:…
Arun VM
  • 447
  • 1
  • 6
  • 17
9
votes
3 answers

Mocking aws-sdk S3#putObject instance method using jest

For the source code containing: const S3 = require('aws-sdk/s3/clients') const s3 = new S3() s3.putObject(params, callback) I have added the following mock based on this article: jest.mock('aws-sdk/s3/clients') const S3 =…
vamsiampolu
  • 6,328
  • 19
  • 82
  • 183
9
votes
2 answers

How to Filter Nested Array Object in DynamoDB

I am very beginner to AWS DynamoDB, I want to scan the DynamoDB with SENDTO.emailAddress = "first@first.com" as FilterExpression. The DB Structure looks like this { ID NAME MESSAGE SENDTO[ { name …
9
votes
3 answers

How to configure AWS S3 SDK for Node.JS to be used with localhost?

I'm trying to use fakes3 as an endpoint for some simple S3 code I've written. I can't get beyond the connection stage though. The current error is: NetworkingError: getaddrinfo ENOTFOUND. I've got configuration setup: "aws": { …
WiredPrairie
  • 58,954
  • 17
  • 116
  • 143
8
votes
2 answers

Get uploaded object URL with Javascript 'aws-sdk' v3

Currently, we are using aws-sdk v2, and extracting uploaded file URL in this way const res = await S3Client .upload({ Body: body, Bucket: bucket, Key: key, ContentType: contentType, }) .promise(); return…
humkins
  • 9,635
  • 11
  • 57
  • 75
8
votes
3 answers

AWS ALB returns 502 Bad Gateway from lambda

I have a lambda function which return base64 string, when I invoke lambda from code it works, but when I call lambda behind ALB and base64 string is large size, ALB gives me error 502 Bad Gateway. Note:for small size string ALB also works. // Lambda…
Dharam
  • 469
  • 2
  • 9
  • 23
7
votes
1 answer

Need to restart the AWS ECS fargate containers when there is an update in the secrets and parameters injected to it

I have a scenario where we have some AWS ECS clusters on Fargate and Secrets injected into those task definitions from Secrets Manager and AWS SSM Parameter store. Now, we want to create a Lambda function to automatically restart the specific task…
Shravani
  • 71
  • 3
1
2
3
34 35