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

How do I mock AWS S3 GetObjectCommand with jest using the v3 sdk?

Testing an s3 upload? The method to test is export class ProcessData { constructor() {} async process(): Promise { const data = await s3Client.send(new GetObjectCommand(bucket)); await parseCsvData(data.Body) } This is my…
Interlated
  • 5,108
  • 6
  • 48
  • 79
11
votes
1 answer

AWS Javascript SDK: upload object with metadata

Tye AWS.S3.ManagedUpload object allows you to upload an object specifying "tags", but I don't see any documentation for specifying meta data on an uploaded object. Is this possible? If so, how?
Mitch
  • 989
  • 1
  • 9
  • 25
10
votes
4 answers

Configuration Error: Missing Region in Config (AWS)

I am getting a configuration error when I run my node application. The error is: { ConfigError: Missing region in config at Request.VALIDATE_REGION (C:\Users\chris\Documents\AWS API…
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
9
votes
2 answers

athena.getQueryExecution returns a status of RUNNING for 1 minute+, even though history says the job took 4 seconds

I'm writing a node app using typescript and the aws-sdk to call Athena. Occasionally, the call to Athena will timeout after a minute of waiting for the Athena response. The thing I don't understand is that if I go to the AWS console and look at…
Daniel Kaplan
  • 62,768
  • 50
  • 234
  • 356
9
votes
2 answers

How to use AWS ECS Task Role in Node AWS SDK code

Code that uses the AWS Node SDK doesn't seem to be able to gain the role permissions of the ECS task. If I run the code on an EC2 ECS instance, the code seems to inherit the role on the instance, not of the task. If I run the code on Fargate, the…
Cristian Vrabie
  • 3,972
  • 5
  • 30
  • 49
9
votes
2 answers

How to Filter Nested Array Object in DynamoDB

I am very beginner to AWS DynamoDB, I want to scan the DynamoDB with SENDTO.emailAddress = "first@first.com" as FilterExpression. The DB Structure looks like this { ID NAME MESSAGE SENDTO[ { name …
9
votes
3 answers

AWS S3 get object using URL

I have a collection of URLs that may or may not belong to a particular bucket. These are not public. I'm using the nodejs aws-sdk to get them. However, the getObject function needs params Bucket and Key separately, which are already in my URL. Is…
Dushyant Bangal
  • 6,048
  • 8
  • 48
  • 80
8
votes
2 answers

Get uploaded object URL with Javascript 'aws-sdk' v3

Currently, we are using aws-sdk v2, and extracting uploaded file URL in this way const res = await S3Client .upload({ Body: body, Bucket: bucket, Key: key, ContentType: contentType, }) .promise(); return…
humkins
  • 9,635
  • 11
  • 57
  • 75
8
votes
1 answer

How to catch failed S3 copyObject with 200 OK result in AWSJavaScriptSDK

Documentation on the S3.copyObject method in AWSJavaScriptSDK indicates the following: A copy request might return an error when Amazon S3 receives the copy request or while Amazon S3 is copying the files. If the error occurs before the copy…
fixermark
  • 1,261
  • 1
  • 14
  • 19
8
votes
2 answers

How can I set the allowed custom scopes of a Cognito User Pool App Client via cli or sdk?

TL;DR: Is there a way to set app client custom scopes via cli or sdk? I'm trying to automate my Cognito deployment with CloudFormation. I've already made some custom resources since not everything is supported. For this I'm using the AWS JS SDK. I…
Kaalaamaazoo
  • 83
  • 1
  • 6
8
votes
1 answer

Getting the "Created" time for a Cognito user with AWS Amplify (or aws-sdk)?

I have a React Native mobile app in which I'm using AWS Amplify to work with my Cognito user pool. I am trying to get the "Created" date of the currently signed in user because I want to show existing users an alert when the app starts, but I don't…
Saad
  • 49,729
  • 21
  • 73
  • 112
8
votes
1 answer

Cloudformation deploy aws sdk for javascript

Looking at the AWS sdk for Javascript, it appears we can only create stacks but i'm looking of a way to deploy a stack. How would I do that with the provided sdk; this is what they currently have: cloudformation.createStack(params, function(err,…
pelican
  • 5,846
  • 9
  • 43
  • 67
7
votes
0 answers

How to upload a stream of an unknown size to AWS S3?

My code runs in a small VM (low memory and low disk), it receives a stream of an unknown size over a HTTP stream and will upload it to AWS S3. It could be a couple TB, I want to be able to reach S3's 5TB maximum, I don't receive a Content-Length…
nraynaud
  • 4,924
  • 7
  • 39
  • 54
1
2
3
46 47