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.
637
questions
0
votes
1
answer
32
views
How to read a large csv as a stream
I am using the @aws-sdk/client-s3 to read a json file from S3, take the contents and dump it into dynamodb. This all currently works fine using:
const data = await (await new S3Client(region).send(new ...
0
votes
0
answers
13
views
How to Automatically sign user in once verification code has verified their account in AWS Cognito sdk nodejs?
how can i automatically sign user in when they verify their verification token after registering in AWS cognito nodejs, because at the moment the user has to register verify token and then sign in, ...
0
votes
0
answers
9
views
AccessDeniedException executing GetParametersByPathCommand with NextToken is used (using @aws-sdk/client-ssm)
I'm getting
AccessDeniedException: User: arn:aws:iam::[ACCOUNTID]:user/esc-user-name is not authorized to perform: ssm:GetParametersByPath on resource: arn:aws:ssm:eu-central-1:[ACCOUNTID]:* because ...
0
votes
1
answer
24
views
Programmatically list supported languages for AWS Transcribe
AWS lists supported languages for Transcribe here: https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html
Short of parsing the documentation page, is there any way to get a list of ...
0
votes
0
answers
11
views
Unable to access CognitoIdentityServiceProvider with credentials after user logged in
I'm currently using this package amazon-cognito-identity-js to login my user using cognito user pool
import { Config, CognitoIdentityCredentials, CognitoIdentityServiceProvider } from "aws-sdk&...
0
votes
0
answers
20
views
I'm getting corrupted files with getObjectCommand() from @aws-sdk/client-s3 V3
I'm trying to download with Node.js (Electrum.js) some file from an S3 bucket to my PC,
The problem happen randomly, some pdf files are downloaded correctly, few are corrupted.
My code is really ...
1
vote
0
answers
24
views
AWS Athena Returning 400 Error on getQueryExecution
I am trying to check the status of an executing Athena query using the NodeJS AWS SDK using AWS.Athena.athenaConn.getQueryExecution and am receiving the following error;
{
"message": &...
0
votes
1
answer
17
views
DynamoDb Multiple Conditional Updates of Non-dependant Attributes
I am using the Javascript SDK for AWS and I am attempting to perform a single update operation on OHLC (Open, High, Low, Close) data and I only want to update the "High" attribute if the new ...
0
votes
1
answer
38
views
Unable to use CognitoIdentityServiceProvider from AWS SDK
I'm currently using amazon-cognito-identity-js and CognitoIdentityServiceProvider
and following this article https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CognitoIdentityServiceProvider.html
...
-1
votes
0
answers
13
views
Not able to create a network using @aws-sdk/client-managedblockchain
i am using @aws-sdk/client-managedblockchain to create a hyperledger network, but i got "InvalidRequestException: Invalid request body", i was follwed below link for help,
"https://docs....
0
votes
1
answer
18
views
AWS SDK v3 for NodeJS doesn't call Lambda nor returns error
I have this Lambda function that calls another Lambda (both in same Lambda application and CloudFormation). Turns out that after lambda.send() is called, the code kind of doesn't proceed method ...
0
votes
0
answers
30
views
`S3Client.send()` doesn't return `VersionId`
I have a bucket which has versioning enabled. In my ReactJS app, I need to upload files to the bucket and receive the new object metadata. I use S3 Client with PutObjectCommand to do the upload. The ...
0
votes
0
answers
21
views
AWS SDK AccessDeniedException: User is not authorized to perform [ACTION] because no session policy allows the action
I am using the AWS Javascript SDK to access the mechanical turk API, but receive the following error:
AccessDeniedException: User: arn:aws:sts::186682853025:assumed-role/Cognito_projectUnauth_Role/...
0
votes
0
answers
8
views
Optimistic Concurrency in DynamoDb using AWS SDK for JavaScript v3
I'm using AWS SDK for JavaScript v3 (@aws-sdk/client-dynamodb)
to work with DynamoDb and need to implement some form of optimistic concurrency. I have multiple lambdas often reading and sometimes ...
0
votes
0
answers
53
views
Unzip large file from S3 and stream back to another bucket without downloading
I have a lambda triggered when a zip file is uploaded. The zip file is large, 200GB+.
Using @aws-sdk/client-s3, how can I stream the zip file, extract and stream back to another S3 bucket without ...
0
votes
0
answers
45
views
ListObjectsV2Command - List and get CSV files on S3 sub folder
I am using AWS S3, Node.js 18x. I have csv files under my S3 subfolders and I want to get those files with a specific date range when it was created for example (jan. 1 - 7 2023). I need those files ...
0
votes
1
answer
99
views
AWS SDK for JavaScript v3 PutObjectCommand error 'A header you provided implies functionality that is not implemented'
I'm trying to upload a file with node.js from my client app (electron) to an S3 bucket in this manner:
const { S3Client, PutObjectCommand } = require('@aws-sdk/client-s3');
const s3Client = new ...
0
votes
0
answers
26
views
AWS SDK for javascript returning 'ReferenceError: debugId is not defined'
I'm trying get my AWS Credentials with the help of the AssumeRoleWithSAMLCommand from the AWS SDK for Javascript. I installed for that only the aws-sdk/client-sts with 'yard add @aws-sdk/client-sts'. ...
2
votes
1
answer
47
views
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.
...
0
votes
1
answer
29
views
Can you use aws-sdk/util-dynamodb unmarshall in Reactjs?
I have an API Gateway resource which calls a Dynamodb post request to query a table. I'm trying to call the API within my React app using Axios. The API is working, returning the data as expected (...
0
votes
0
answers
24
views
AWS SDK ResourceConflictException: The operation cannot be performed at this time. The function is currently in the following state: Pending
Getting ResourceConflictException while invoking the lambda function just created before. It used to work about a year or so ago but not it works ONLY if I add delay between create function and invoke ...
0
votes
1
answer
25
views
DynamoDB return the modified document (Old or new) when using TransactWrtieItems
Is there a way of making transactWriteItem return the document it updated?
const transactionParams = {
ReturnConsumedCapacity: "INDEXES",
TransactItems: [
{
Delete: {
...
-1
votes
1
answer
25
views
How i can list all log in a group in lambdafunction aws
I try with @aws-sdk.
I don't know what is function support to list logs.
0
votes
1
answer
47
views
How do I use Heartbeat with a Callback Return Step Function in my Lambda Function?
My Lambda function is required to send a token back to the step function for it to continue, as it is a task within the state machine.
Looking at my try/catch block of the lambda function, I am ...
0
votes
1
answer
93
views
SQS send message error using @aws-sdk node js at AWS lambda
I am trying to send message from my AWS Lambda to AWS SQS but it isn't quiet working and throwing me the error.
2022-12-26T14:58:31.651Z 282ada00-ea4a-45b6-afe4-e3a7f16e8c5a INFO ...
0
votes
1
answer
113
views
Cognito Authorization with Azure AD SAML integration returns id_token and access_token but no refresh token
I have a cognito User Pool with 1 client that is configured with 2 identity providers, Cognito User Pool and a SAML provider that links an Azure AD instance. The Allowed OAuth Flows is set Implicit ...
1
vote
0
answers
32
views
Is there a way to update headers of Chime Messaging API of aws-sdk/clients/chimesdkmessaging in ReactJs?
I am using aws-sdk/clients/chimesdkmessaging to make requests to get/delete/send channel messages.
But the issue is that the temporary credentials are expired after 1 hour and I cannot use the ...
0
votes
1
answer
85
views
AWS SDK: Pre-signed URL for multiple file uploads
Is it possible to generate Pre-signed URL for multiple file uploads with AWS SDK?
I am using JavaScript SDK and the code below is working for a single file upload.
import { S3Client, PutObjectCommand }...
0
votes
0
answers
17
views
Is there a way to update headers of Chime Messaging API of aws-sdk/clients/chimesdkmessaging in ReactJs?
I am using aws-sdk/clients/chimesdkmessaging to make requests to get/delete/send channel messages.
But the issue is that the temporary credentials are expired after 1 hour and I cannot use the ...
1
vote
1
answer
148
views
What is the difference between @aws-sdk/client-ses and @aws-sdk/client-sesv2?
AWS's SDK for JavaScript version 3 seems to have 2 different clients for Simple Email Service (SES).
I realized I have been using @aws-sdk/client-sesv2 but:
The actual doc on their GitHub repos is ...
0
votes
0
answers
46
views
What are the rules regarding undefined values and lists in DynamoDB GetItem ProjectionExpressions and UpdateItem ReturnValues?
I regularly use the AWS SDK for JavaScript (Typescript, really) to perform DynamoDB DocumentClient queries and am looking to make my type assertions of the response accurate. Specifically, when using ...
0
votes
0
answers
18
views
how to access AWS.Response body from client SDK request? [duplicate]
I can't seem to work out how to access to the data or error object when making an AWS client request
I do NOT want to use the async promise feature. This is purely a question of how to access the data ...
0
votes
1
answer
20
views
getting the EC2 Instance List and the networkIn networkOut data by using AWS SDK JavaScript
I am trying to using AWS-SDK For JavaScript to generate a monthly report of EC2 Instance for own use. I want to get the last month usage data by using CloudWatchClient and EC2Client.
const ...
0
votes
1
answer
110
views
How to use aws s3 createPresignedPost with ksm encryption
I have found aws documentation for doing this with Java, and a couple of scattered references for javascript developers, but I have not been able to accomplish this without receiving access denied ...
0
votes
2
answers
235
views
DynamoDB JavaScript PutItemCommand is neither failing nor working
Please note: although this question mentions AWS SAM, it is 100% a DynamoDB JavaScript SDK question at heart and can be answered by anyone with experience writing JavaScript Lambdas (or any client-...
0
votes
0
answers
60
views
Get email status per destination separately, when sending an email group of destinations in AWS SES
In order to deliver my transactional mail, I have set up an Amazon SES account. It appears to be performing nicely. But I have to keep track of each email's remote server response (when it is sent, ...
0
votes
0
answers
88
views
how should I import aws-sdk?
I tried to import aws-sdk/client-personalize-import but it didnt work.
it showed error described below.
Should i import another modules or something?
or anybody has idea if it is built on vue.js?
...
0
votes
2
answers
48
views
AWS S3: can I move object within a bucket by changing its key?
I have a javascript lambda function that is triggered by file upload, reads the content, validates, converts data records contained therein into an array and puts data into a DynamoDB table.
When ...
1
vote
1
answer
59
views
Rupee symbol(₹) in pdf is missing after upload to S3
I have a pdf which has rupee symbol(₹) in it. I am using aws-sdk with nodejs to upload the pdf to s3.
Rupee symbol is missing after uploading to s3.
In local, while I upload, it is working fine. Where ...
0
votes
0
answers
116
views
how to download all files in an s3 folder using AWS Javascript/Node SDK
I currently have multiple files under a folder in an s3 bucket that I wish to download all at once into a local folder (created during run time) using javascript/node sdk.
My attempt is below:
import {...
0
votes
1
answer
35
views
Upload static web to AWS s3 with Node JS break static web hosting
I am planning to deploy next.js static export to s3 bucket with Node JS script.
I have setup a S3 bucket for static website hosting.
I get the expected behaviour when I simply drag and drop the static ...
1
vote
2
answers
126
views
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 ...
0
votes
0
answers
21
views
Receive 'SignatureDoesNotMatch' response when S3.getObject().promise()
First of all, I solved issue but I want to know exactly why this happened.
I'm using aws-sdk for javascript v2 like
await s3
.getObject({ Bucket: bucketName, Key: key }, (err, data) => {
...
0
votes
1
answer
45
views
Mock JavaScript class in another file
I have a function which uses the AWS sdk source:
import {
SignUpCommand,
CognitoIdentityProviderClient,
} from "@aws-sdk/client-cognito-identity-provider";
import { ...
0
votes
1
answer
125
views
unctx:transfrom Unexpected token (65:4) file: /node_modules/nuxt/dist/pages/runtime/router.mjs:65:4 NUXT 3.0
When I try to run npm run generate it is giving me this error
It should generate the static nuxtjs site.
Before it was on Nuxt-3-rc and it was building site successfully. As I converted it to Nuxt 3....
0
votes
0
answers
24
views
Using a cognito identity pool for an app running on Game Center
We're considering using AWS Amplify for a Game Center App and are looking into using AWS Cognito. Currently, all of our authentication on the server side is being done via the fetchitems flow, which ...
0
votes
2
answers
264
views
Getting credentials for logged in user via Amplify Auth
I am using AWS Amplify for a ReactJS application. The only two functional areas I am using from Amplify are Authentication and Hosting. These two are working fine, and a Cognito user pool associated ...
0
votes
0
answers
42
views
Node.js - Files Uploaded to an S3 bucket from another S3 bucket doesn't display on page
I'm copying image files from an AWS S3 bucket to another S3 bucket using a Node.js program. Copied image files will be displayed on a React.js page.
The files did get copied and I can see them in S3 ...
0
votes
1
answer
45
views
Query on Dynamodb with GSI along with extra Attribute
I am new to dynamodb. I am trying to query on GSI PlatformIndex, Where platform = "x" and it'll be sorted by tx_time. But I also need to match another attribute senderWallet = "y". ...
0
votes
0
answers
22
views
AWS JS GameLift SDK MatchmakingTicket - is there a push mechanism instead of polling?
In AWS GameLift, the following code creates a matchmaking ticket:
import { GameLiftClient, StartMatchmakingCommand } from "@aws-sdk/client-gamelift"; // ES Modules import
// const { ...