Questions tagged [aws-sdk-js-v3]

53 questions
1
vote
2 answers

@aws-sdk/client-sts - TypeError: (0 , smithy_client_1.parseRfc3339DateTimeWithOffset) is not a function

I'm facing issue using sts client on lambdas. The current code was working two days ago. const { STSClient, AssumeRoleCommand, } = require('@aws-sdk/client-sts') const stsClient = new STSClient({ region: process.env.REGION ||…
Dibi91
  • 31
  • 7
1
vote
0 answers

AWS Cognito - ResourceNotFoundException and GroupExistsException in test cases

I'm writing test cases that repeatedly call CreateGroup, UpdateGroup and DeleteGroup for AWS Cognito and validate if these changes were successful by reading the respective group via GetGroup via the AWS SDK for JS v3. However, I noticed a strange…
1
vote
1 answer

Users unable to authenticate with their email and password with AWS Cognito

I have a test user who has confirmed their email with AWS Cognito. I get a NotAuthorizedException: Incorrect username or password. when I attempt to initiate auth with them using their email and password. Currently, I can only authenticate users…
Alex Fallenstedt
  • 2,040
  • 1
  • 18
  • 34
1
vote
0 answers

@aws-sdk/client-s3 --> No 'Access-Control-Allow-Origin' header is present on the requested resource

I'm trying to upload from localhost to digital ocean's space . For this, I use the npm package. But I am getting the error given below. What code should I add to this package so that I don't get an error. Access to fetch at…
1
vote
1 answer

AWS Aurora MySQL prepared statement

I have an insert query that I want to execute using the JavaScript V3 AWS client, against an AWS Aurora MySQL Serverless database. I am using the Data API of the database. I got the @aws-sdk/client-rds-data set up in my code and I can connect and…
Bora
  • 1,778
  • 4
  • 17
  • 28
1
vote
1 answer

How to invoke a new EC2 instance with existing IAM role? / JavaScript AWS SDK v3 - RunInstancesCommand

How can I launch an EC2 instance with attached (existing) IAM Role in JavaScript? I know this question has been asked for other languages, but I couldn't find an example for JavaScript. My JS Lambda code currently looks like: const { EC2Client } =…
1
vote
1 answer

AWS SDK JavaScript v3 / How to use ExpressionAttributeNames within dynamoDB Scan Command?

I'm using a Lambda function which gets me the user email from a user id within a dynamoDB table. I use the dynamoDB scan command to scan over all items within the dynamoDB table. I use the new v3 AWS JS SDK. Question: Why does…
1
vote
1 answer

RedshiftDataClient BatchExecuteStatement combines all the queries in one

I am using the BatchExecuteStatement command in the RedshiftDataClient (@aws-sdk/client-redshift-data 3.39.0) to execute a number of queries against redshift. This wasn't updating the database but not throwing an error either, so in order to…
1
vote
1 answer

aws-sdk-js for translate client results an error "cannot read property 'byteLength' of undefined"

I run the AWS SDK V3 Translate Client in Node.js application to translate a sentence. This is my code: const { TranslateClient, CreateParallelDataCommand } = require("@aws-sdk/client-translate"); const client = new TranslateClient({ region:…
1
vote
1 answer

AWS SDK 3 WriteGetObjectResponseCommand issue

On my current project we are trying to migrate to AWS SDK version 3 (Javascript). We are using s3 object lambdas and have faced and issue with WriteGetObjectResponseCommand command. WriteGetObjectResponseCommand code: import { S3Client, S3 } from…
1
vote
3 answers

aws-sdk v3 cannot find credentials

I'm using v3 of aws-sdk, trying to follow the reference docs exactly, but cannot load credentials. const {fromIni} = require("@aws-sdk/credential-provider-ini"); const credentials = fromIni({}); ... gives the error: Unhandled Rejection (Error):…
weegolo
  • 354
  • 2
  • 14
1
vote
2 answers

How do I get a signed cookie in aws-sdk-js-v3

I'd like to use signed cookies to view private content stored on S3 with CloudFront for CDN. I can't figure out which commands to use to get signed cookies in aws-sdk-js-v3. Per the new SDK docs it should look something like the second code sample…
1
vote
3 answers

Migration aws-sdk-js v2 to v3. Error Sharp: Input file is missing

Works with aws-sdk-js v2: const Sharp = require('sharp'); const AWS = require('aws-sdk'); const S3 = new AWS.S3({ signatureVersion: 'v4' }); const originalPhoto = (await S3.getObject({ Bucket: "myBucket", Key: "myKey" }).promise()).Body; const…
alditis
  • 4,633
  • 3
  • 49
  • 76
1
vote
1 answer

Insert Standard JSON into DynamoDB aws-sdk js v3

I am trying to register Standard JSON in DynamoDB using aws-sdk version 3 for JS in the thumbnail field. In version 2 it was allowed using the put method, in the version 3 now are commands but I not see an equivalent command. My code: const {…
alditis
  • 4,633
  • 3
  • 49
  • 76
0
votes
1 answer

AWS XRay with AWS SDK v3 for NodeJS: typing issues

I'm moving my xray tracing for my aws-sdk from v2 to v3 and having some issues using the code provided from aws here: https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-nodejs-awssdkclients.html As well as some example code provided by a user…