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
3
votes
2 answers

AWS-SDK-S3-Client throws "Error: Resolved credential object is not valid" while executing putObject command

When I am trying to upload a file using aws-sdk-s3-client in nodejs. It throwing an validation error: Error: Resolved credential object is not valid at SignatureV4.validateResolvedCredentials…
Vivek
  • 31
  • 2
3
votes
1 answer

How to SSO login to AWS in Docker container (using aws-sdk v3)

When developing locally, I need to have access to an S3 bucket. The access is provided via SSO. I'm using aws-sdk v3 and node.js. When running the same node.js app without docker, I get access and everything works fine. Here's what I do: aws…
Denis Yakovenko
  • 3,241
  • 6
  • 48
  • 82
3
votes
1 answer

How to hard code credentials AWS SES JS SDK V3

AWS forced me to upgrade do SDK V3, and now I'm having such a hard time setting up my credentials. They used to be hard-coded like: AWS.config.update({ apiVersion: "2010-12-01", accessKeyId: "MYKEY", secretAccessKey: "MYOTHERKEY", region:…
3
votes
2 answers

What is the Lambda handler Signature for AWS SDK V3 with TypeScirpt

I'm updating an existing project from V2 to V3 of the AWS SDK for JavaScript and also moving our usage from JavaScript to TypeScript. I'm struggling to define strongly typed handlers for the Lamdas. The examples I've found are similar to this. I'm…
Damien Sawyer
  • 5,323
  • 3
  • 44
  • 56
3
votes
1 answer

@aws-sdk/client-s3 S3Client returning Error TypeError: Cannot read properties of undefined (reading 'send')

Following along with the AWS-SDK examples/documentation in a Gatsby app, I have the workflow below setup to upload a file to my S3 bucket from the client directly however, the const data = await client.send(...) is returning Error TypeError: Cannot…
3
votes
0 answers

DeleteItemCommand from aws-sdk/client-dynamodb doesn't work as expected

I've been trying to delete an item from a DynamoDB table, with no success and no actual errors. My delete function is as follows: public async deleteToken(token: string) { const input: DeleteItemCommandInput = { TableName: this.tableName, Key:…
GerryG
  • 31
  • 1
3
votes
1 answer

Unable to compile Typescript: property send does not exist on s3client

I'm using v3 of the AWS SDK for javascript in a typescript/nodejs environment, but when I run it with ts-node, it complains about being unable to find the send function on the s3client. My code: const client = new S3Client({ …
whiterook6
  • 3,270
  • 3
  • 34
  • 77
3
votes
1 answer

Invoking second async function in lambda not invoking

I am using serverless to deploy aws lambdas. Currently my set up is that api gateway triggers one lambda then I async invoke another lambda. serverless.yml service: scraper useDotenv: true #added this because deprecation notice frameworkVersion:…
Cyzanfar
  • 6,997
  • 9
  • 43
  • 81
3
votes
2 answers

How to invoke a lambda function in aws-sdk v3

How can I invoke a lambda function using Javascript (TypeScript) aws-sdk v3? I use the following code which does not seems to work: // the payload (input) to the "my-lambda-func" is a JSON as follows: const input = { name: 'fake-name', …
A-Sharabiani
  • 17,750
  • 17
  • 113
  • 128
3
votes
0 answers

Reactjs Integration Testing Cognito Native Crypto Module Could Not Be Used To Get Secure Random Number

I have an integration test that uses the AWS Cognito library; specifically, I'm calling CognitoUser.authenticateUser(). When I start my webpage this all works fine: however, in my tests I'm getting the following error: Error: Native crypto module…
Przemek Lach
  • 1,348
  • 2
  • 19
  • 42
3
votes
1 answer

AWS Eventbridge Name param

I'm implementing a AWS v3 event bridge from inside a Typescript application we have, using this library https://www.npmjs.com/package/@aws-sdk/client-eventbridge however when I run this code: import { EventBridgeClient, ActivateEventSourceCommand }…
neophytte
  • 648
  • 2
  • 11
  • 25
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…
3
votes
1 answer

How to get a cognito users' group (in AWS JS SDK V3)

I try to migrate from AWS JavbaScript SDK V2 to V3. I want to retrieve the user groups a logged-in Cognito user (form an identity pool) belongs to. In V2, this was as easy as looking in the ["accessToken"].payload['cognito:groups'] element of the…
HOK
  • 225
  • 1
  • 11
3
votes
1 answer

How to refresh credentials in the AWS JS SDK v3?

I am trying to migrate my V2 application to the V3 SDK and I can't seem to figure out how to refresh the credentials after the following call throws a NotAuthorizedException with "Invalid login token. Token expired: 1615301743 >= 1615108625". …
comonadd
  • 1,822
  • 1
  • 13
  • 23
3
votes
1 answer

Delete gcp bucket objects using s3 api

My code to delete the objects look like this: const s3 = new AWS.S3({ endpoint: spaceEndpoint, accessKeyId, secretAccessKey, }) const params = { Bucket: bucketName, Delete: { Objects: assetsToDelete, }, } try { …