Questions tagged [aws-sdk-js-v3]

53 questions
0
votes
1 answer

TypeError: Cannot read property 'decode' of undefined in React Native with AWS S3 SDK

It's been a joruney trying to get simple file uploads to an AWS S3 bucket working from my react native app built with expo. Current problem: Upon attempting the upload, I get an error saying: Failed to construct URL with https://[bucket…
Jordy337
  • 390
  • 2
  • 5
  • 17
0
votes
1 answer

data.location not working in aws-sdk-js-v3

I'm using MEAN stack to build a chatapp and the user needs to upload a profile image at some point so i decided to use s3 to store the images and get the image URLs stores in my mongodb database so they are displayed in the fronted from the…
0
votes
0 answers

Getting Error : Can't walk dependency graph when importing @aws-sdk/client-s3

Inside a Cypress test I am adding a new function to upload a file in S3. I am making my function very simple for the moment : Cypress.Commands.add('uploadToS3', () => { (async function() { // Load the S3 client and commands for Node.js …
Ziwdigforbugs
  • 1,185
  • 8
  • 24
  • 41
0
votes
0 answers

Creating an image with gm and uploading to S3, v3

Many moons ago I made a tiny Lambda in NodeJS 8.x which created a PNG file to display a bunch of generated text and uploaded to S3 using s3.upload and it worked fine. I now want to transition to NodeJS 18.x and the v3 AWS SDK, but it seems…
0
votes
1 answer

export 'S3Client' (imported as 'S3Client') was not found in '@aws-sdk/client-s3'

I am using the serverless framework and create a TypeScript based serverless API and trying to work with the AWS JavaScript v3 SDK. Currently I have this in my package.json: "dependencies": { "@aws-sdk/client-s3": "^3.367.0", …
0
votes
1 answer

Boto3 and botocore python equivalent for credentials calls in typescript

2 I have inherited a python lambda which I need to convert to node js. I am a bit stuck with the code that handles authentication and so I am wondering what the JS equivalent would be for the python code below: import boto3 import json import…
0
votes
0 answers

Extracting bucket and key from S3 url

In order to delete a file from S3 with given a file url like https://user-files.s3.us-east-1.amazonaws.com/1234-5678/image.png, is there a way to delete the file using the url? If bucket and key are a must, is there an official way to extract them…
Benny67b
  • 509
  • 1
  • 6
  • 18
0
votes
2 answers

What to use instead of aws.Endpoint in AWS SDK v3?

I have started migration of AWS SDK from v2 to v3. Can`t figure out what to use to create endpoint for S3. In v2 I have: const aws = require('aws-sdk'); const ep = new aws.Endpoint(s3.region.amazonaws.com); What package need to use in V3 for this ?
0
votes
0 answers

How to get the responseEventStream from Lex V2

I am trying to create a chatbot using Amazon Lex V2 and I plan to make use of the steaming API using their Javascript v3 SDK. I've tried the following import { LexRuntimeV2 } from '@aws-sdk/client-lex-runtime-v2' const client = new…
driven1983
  • 21
  • 1
0
votes
1 answer

How to use the functions in the aws-sdk-js-v3?

I am trying to use one of the functions given in the @aws-sdk/lib-dynamodb documentation. It is called unmarshallOutput. How do I make use of this function in my code? import { DynamoDBClient, ScanCommand } from "@aws-sdk/client-dynamodb"; const…
0
votes
1 answer

How to lookup cognito user by their uuid with AWS SDK V3

I want to find users by their sub uuid. In v2 (inspired from How do I look up a cognito user by their sub/UUID?) require('dotenv').config(); var AWS = require('aws-sdk'); AWS.config.setPromisesDependency(require('bluebird')); module.exports = { …
MrJibus
  • 103
  • 8
0
votes
0 answers

`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 documentation here states: Versioning If you…
0
votes
0 answers

CDK + SAM LOCAL + AWS-SDK v3

I have a cdk project that includes lambda functions, dynamodb and api gateway. To run it locally I use SAM local: sam local start-api -t ./cdk.out/stackName.template.json In the project I use aws-sdk v2 and everything works fine. Now, I want to…
0
votes
0 answers

Node core function for reading streams not recognized in React Native app made with AWS SDK

With some trivial modifications (including a conversion to TypeScript), I copied and pasted the JS code from this Amazon S3 Node.js example into a React Native app that I'm developing with Expo and USB debugging on Android. I want my program to read…
0
votes
1 answer

I need to implement a file upload feature so that any user could upload a file in AWS S3 bucket from frontend. My project is in Typescript Language

I have achieved it by using the AWS credentials embedded in the code. But this is not good practice ..could someone suggest another way to do that maybe by using IAM role or assume role. Code for receiving the file from frontend