Questions tagged [aws-sdk-js-v3]
53 questions
27
votes
2 answers
How to upload a stream to S3 with AWS SDK v3
I have to transfer a file from and API endpoint to two different bucket.
The original upload is made using:
curl -X PUT -F "data=@sample" "http://localhost:3000/upload/1/1"
The endpoint where the file is uploaded:
const PassThrough =…

Hollyol
- 827
- 1
- 13
- 25
9
votes
1 answer
Exception on SubscribeToShard Command
I'm trying to subscribe to events from Kinesis Shard.
But the execution of SubscribeToShardCommand hangs for 5 minutes (timeout for subscribe) and then throws an error:
(node:2667) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token in…

mjpolak
- 721
- 6
- 24
9
votes
1 answer
Node AWS SDK v3: Types for `event` and `context` arguments in Lambda functions?
I'm switching to the new Node AWS SDK (v3) to take advantage of its modularity and Typescript support. The first thing I needed to do was to write a Lambda function, but I can't find types to support the handler function signature. The types in the…

Adam Coster
- 1,162
- 1
- 9
- 16
6
votes
0 answers
Using AWS DynamoDBDocumentClient for Marshall/Unmarshall Complex Objects Throws an Error
I'm using AWS SDK (v3) in my NodeJS/Typescript application, specifically their DynamoDBDocumentClient to easily marshall/unmarshall my entities to reduce the amount of code needed to query the database.
As my entities are complex objects, meaning…

LioRz
- 835
- 1
- 9
- 17
6
votes
2 answers
Set customBackoff for AWS SDK JavaScript V3 retries
I just upgraded to AWS SDK V3 and I have no idea how to configure retryDelayOptions and customBackoff with it. I couldn't find any example code in AWS's own API reference or online. This is what I was doing previously:
retryDelayOptions: {…
5
votes
1 answer
S3 ManagedUpload equivalent in aws javascript sdk v3?
In the older version of javascript I was using managedupload function for uploading big files to s3, which will do the queueing and manage multiparting of files. But in V3 this function is not anywhere in documentation, is that removed? or is there…

vinith p
- 53
- 4
4
votes
1 answer
Why does the Cost Explorer Client show wrong results when I have AWS credits?
When using AWS Console --> AWS Cost Management --> Cost Explorer - I get the following values:
When I use @aws-sdk/client-cost-explorer I get different results for 'EC2 - Other' and 'Amazon Load Balancer'.
Configuration:
import {…

Oron Bendavid
- 1,485
- 3
- 18
- 34
3
votes
2 answers
AWS Timestream - SDK V3 Nodejs, TimestreamWriteClient.send() - TypeError: command.resolveMiddleware is not a function. How to solve this?
I have the following lambda function in NodeJs 14.x using AWS SDK V3 for a timestream insertion process:
'use strict'
// https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-timestream-write/index.html
const { TimestreamWriteClient…

IgorAlves
- 5,086
- 10
- 52
- 83
3
votes
1 answer
How to get aws kms encrypt response as base64 string in sdk v3. Getting Uint8Array as response
I am using @aws-sdk/client-kms to encrypt the data. I was getting the base64 string as a response. Now I am getting Uint8Array.
const encryptedBlob = await kms.encrypt({
KeyId: kmsKey,
Plaintext: Buffer.from(JSON.stringify('data to…

Arpit Yadav
- 516
- 8
- 21
2
votes
0 answers
How to turn on wire logging in AWS SDK v3 for Node
How can I log the full HTTP request and response when using the AWS SDK v3 for Node / javascript?

Rich
- 15,048
- 2
- 66
- 119
2
votes
2 answers
Decrypting cognito codes with KMS client from aws-sdk-v3
I am following this instruction to implement custom message sender in Cognito https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-sms-sender.html
All works well with similar code (I use Typescript on AWS Lambda):
import…

pkozlov
- 746
- 5
- 17
2
votes
0 answers
adding inbound rule to existing aws security group using node js sdk
const instanceParams = {
GroupId: "sg-0bd930929e79ecbe0",
IpPermissions: [
{
FromPort: 22,
IpProtocol: "tcp",
IpRanges: [
{
CidrIp: "203.0.113.0/24",
…

piash
- 153
- 1
- 5
2
votes
1 answer
aws-sdk v3 lambda region missing even after providing region
I'm migrating aws-sdk from v2 to v3 and I'm having trouble setting up the lambda client. I'm providing region during the instantiation of lambda client as shown in the docs but while running InvokeAsyncCommand on the client, I get "Region is…

Sisir
- 218
- 1
- 12
1
vote
0 answers
Use @aws-sdk/client-transcribe-streaming with react-native and expo-av to transcribe audios
I am currently using expo with react-native and I am facing some difficulties in implementing the usage of @aws-sdk/client-transcribe-streaming.
I saw an implementation with 'react-native-live-audio-stream' but since I am using 'expo', I thought…

docksdocks
- 108
- 9
1
vote
0 answers
Writing a generic wrapper function to rate-limit Promise.allSettled()
I am using the Javascript SDK v3 to submit several API commands in parallel. The general flow is
const client = new SomeAWSClient(config) const response: Promise = client.send(new SomeAWSClientCommand(input))
I am looking…

scramjet
- 13
- 4