64 questions
188 votes
9 answers
156k views
Nodejs AWS SDK S3 Generate Presigned URL
I am using the NodeJS AWS SDK to generate a presigned S3 URL. The docs give an example of generating a presigned URL. Here is my exact code (with sensitive info omitted): const AWS = require('aws-...
4 votes
1 answer
11k views
What should be done when the provisioned throughput is exceeded?
I'm using AWS SDK for Javascript (Node.js) to read data from a DynamoDB table. The auto scaling feature does a great job during most of the time and the consumed Read Capacity Units (RCU) are really ...
8 votes
6 answers
19k views
Wait for AWS SNS publish callback to return a value to calling method
I am attempting to send a text message when a user requests to reset their password. I would like to wait for the message to be sent to alert the user if it was successful or not. I am currently ...
48 votes
2 answers
56k views
Unmarshall DynamoDB JSON
Given some DynamoDB JSON via a DynamoDB NewImage stream event, how do I unmarshall it to regular JSON? {"updated_at":{"N":"146548182"},"uuid":{"S":&...
34 votes
4 answers
75k views
How to set credentials in AWS SDK v3 JavaScript?
I am scouring the documentation, and it only provides pseudo-code of the credentials for v3 (e.g. const client = new S3Client(clientParams) How do I initialize an S3Client with the bucket and ...
23 votes
4 answers
30k views
How do I mock AWS S3 GetObjectCommand with jest using the v3 sdk?
Testing an s3 upload? The method to test is export class ProcessData { constructor() {} async process(): Promise<void> { const data = await s3Client.send(new GetObjectCommand(bucket)); ...
11 votes
2 answers
20k views
ListObjectsV2 - Get only folders in an S3 bucket
I am using AWS S3 JS SDK. I have folders within folders in my S3 bucket and I would like to list only folders at a certain level. This is the structure: bucket/folder1/folder2/folder3a/file1 bucket/...
7 votes
1 answer
12k views
AWS: Unable to login into aws-sdk using sso credentials
I am trying to access AWS resources with AWS-SDK using SSO credentials from the node.js application. For this, first I have created my SSO profile from AWS CLI and then I am trying to use same profile ...
7 votes
4 answers
12k views
How do I set a timeout for AWS V3 Dynamo Clients
I have started using the new AWS Version 3 sdk for some of my services. Unfortunately it is not always clear how to use some features in the modular version 3 code that are available in the Version 2 ...
6 votes
1 answer
7k views
Error "URL.hostname is not implemented", AWS SNS in React Native Android
Using SNS service from the AWS SDK for JavaScript v3 in React Native When I try to create an endpoint (or execute really any command through AWS) I'm getting this error URL.hostname is not implemented ...
4 votes
2 answers
3k views
AWS JS SDK V3 (Lambda module) - Unable to connect to instance metadata service
I was previously using the all-in-one aws-sdk npm module (https://www.npmjs.com/package/aws-sdk) to invoke an AWS Lambda function, and for that the following code had been working well: //...
2 votes
3 answers
10k views
How to setup AWS-SDK credentials in NextJS
I need to upload some files to S3 from a NextJs application. Since it is server side I am under the impression simply setting environment variables should work but it doesn't. I know there are other ...
0 votes
1 answer
778 views
How do I use eval(UrlFetchApp.fetch()) to load external javascript in my google apps script?
I am trying to send an email from a Google Apps Script function (using Amazon SES Javascript SDK) using the below code - function sendemail(email,name,code,date,expiry,version) { eval(UrlFetchApp....
27 votes
3 answers
32k views
dynamodb.put().promise() not returning the put object
I am trying to make use of the async/await functionality with regard to aws and dynamo db. Below is an example of how to put an object pre asyn await, as you can see in the callback you have access to ...
23 votes
1 answer
17k views
Does AWS Lambda support aws-sdk v3 or not?
I have based a small lambda function off the cdk workshop here. I'm writing the lambda function in typescript, deploying via a pipeline which creates a cloud formation stack containing the lambda ...