Questions tagged [aws-sdk-js]

The official AWS SDK for JavaScript provides an API to many AWS services, including: S3, SNS, SQS, EC2, Route53, etc... This library can be used in front-end Javascript which is executed in the browser as well as in NodeJS.

aws-sdk-js

aws-sdk-js exists to help you interact with many AWS services (e.g. EC2, SQS, S3) programmatically in Javascript. This tag should be used for asking questions related to this official AWS SDK for Javascript.

Before asking questions, please make sure that you have reviewed the documentation provided by AWS. See the following important links:

702 questions
176
votes
8 answers

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-sdk') const s3 = new…
Dustin
  • 2,091
  • 3
  • 15
  • 13
41
votes
2 answers

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":"foo"},"status":{"S":"new"}} Normally I would use AWS.DynamoDB.DocumentClient, however I can't seem…
hendry
  • 9,725
  • 18
  • 81
  • 139
31
votes
4 answers

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": "commonjs", "lib": ["es2020"], "outDir": "dist", "resolveJsonModule": true, }, …
Kerruba
  • 1,779
  • 1
  • 17
  • 25
26
votes
3 answers

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 data which contains the put object. However in…
22
votes
1 answer

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 function. I'm trying to use the sdk v3 in lambda, as…
thinkOfaNumber
  • 2,581
  • 3
  • 27
  • 46
21
votes
2 answers

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 bucket. Just for convenience, the code is being…
Waleed93
  • 1,130
  • 2
  • 15
  • 24
20
votes
4 answers

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 information, check the migration guide at…
Steve Bennett
  • 114,604
  • 39
  • 168
  • 219
20
votes
4 answers

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 And we can access it in our lambda function like…
Ole
  • 41,793
  • 59
  • 191
  • 359
19
votes
3 answers

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 credentials to perform a getSignedUrl request? Any…
Joel Hager
  • 2,990
  • 3
  • 15
  • 44
19
votes
4 answers

'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 (assuming a role with permission to call getObject)…
Waleed93
  • 1,130
  • 2
  • 15
  • 24
18
votes
1 answer

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 module has, but there seems to be numerous gaps,…
16
votes
2 answers

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:…
CodyBugstein
  • 21,984
  • 61
  • 207
  • 363
15
votes
1 answer

binary vs. string vs. number for storing UUID in DynamoDB partition key?

I'm trying to decide whether to use binary, number, or string for my DynamoDB table's partition key. My application is a React.js/Node.js social event-management application where as much as half of the data volume stored in DynamoDB will be used…
12
votes
3 answers

DynamoDB get item TypeScript hell

Can anyone explain how to use GetItemInput type when calling DocumentClient.get ? If I pass in an object of any type get works but if I try and strongly type the params object I get this error: ValidationException: The provided key element does not…
11
votes
1 answer

AWS Cognito Respond to New_Password_Required challenge returns "Cannot modify an already provided email"

An app that has been working successfully for a couple years has started throwing the following error whenever trying to respond to the NEW_PASSWORD_REQUIRED challenge with AWS Cognito: {"__type":"NotAuthorizedException","message":"Cannot modify an…
Noelle Bott
  • 152
  • 1
  • 9
1
2 3
46 47