734 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-...
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":&...
37 votes
4 answers
16k views
AWS Javascript SDK v3 - Typescript doesn't compile due to error TS2304: Cannot find name 'ReadableStream'
I'm trying to build my project that uses the AWS Javascript SDK v3. Here my tsconfig.json { "compilerOptions": { "target":"ES2020", "module": "...
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 ...
31 votes
3 answers
32k views
How to Get Signed S3 Url in AWS-SDK JS Version 3?
I am following the proposed solution by Trivikr for adding support for s3.getSignedUrl api which is not currently available in newer v3. I am trying to make a signed url for getting an object from ...
31 votes
4 answers
43k views
Suppress AWS SDK v2 deprecation message
I am seeing an awful lot of this message: NOTE: The AWS SDK for JavaScript (v2) will be put into maintenance mode in 2023. Please migrate your code to use AWS SDK for JavaScript (v3). For more ...
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
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)); ...
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 ...
23 votes
1 answer
7k views
Does the aws-sdk for SESv2 lack certain functionality compared to SES, the base version?
I am confused by the difference in the javascript aws-sdk between SES and SESV2. My default assumption would be that V2 is an upgrade/update and should cover all the functionality that the base SES ...
20 votes
4 answers
16k views
Creating process.env variables using AWS Amplify?
With serverless we can add process.env variables by creating a configuration file entry like this: environment: STRIPE_SECRET_KEY: ${self:custom.secrets.stripeSecretKey} # Stripe secret API key ...
19 votes
4 answers
15k views
'Credential is missing' Error On Instantiating S3 Class Using AWS-SDK JS V3
I am getting en error when creating S3 client from class S3 in newer v3 of aws-sdk javascript. I add aws config parameters including credentials obtained from aws sts when user gets authenticated (...
18 votes
2 answers
30k views
How can you programmatically create a user in a Cognito User Pool?
The AWS documentation indicates that it is possible for an admin to create a user pool user in AWS Cognito using the API. Here is the documentation I am referring to: https://docs.aws.amazon.com/...
15 votes
2 answers
32k views
S3 getSignedUrl v2 equivalent in AWS Javascript SDK v3
I just started using aws-sdk on my app to upload files to S3, and i'm debating whether to use aws-sdk v2 or v3. V2 is the whole package, which is super bloated considering i only need the s3 services, ...
15 votes
3 answers
14k views
Getting a Readable from getObject in AWS S3 SDK v3
I'm in the process of converting a library that uses v2 of the AWS S3 SDK to v3. My library is an implementation of an interface of another library. The other library offers the interface to abstract ...