Questions tagged [aws-sdk]

The software development kit for use with the Amazon Web Services API.

The AWS SDK provides a language/platform-specific interface for API access to AWS services. For CLI access, see or .

Usage Guidance

  • Use the language/platform you're working on. For example, if you're using the Go SDK, tag your question with both . If the tag exists for a specific language, like , or — use it as well.
  • Do not use this tag for AWS CLI questions. Use instead.
  • Do not use this tag for AWS Tools for PowerShell questions. Use instead.

SDKs

An SDK is available in the following languages/platforms:

Links

AWS SDK Code Samples/Examples

6213 questions
76
votes
7 answers

AmazonS3Client(credentials) is deprecated

I'm trying to read the files available on Amazon S3, as the question explains the problem. I couldn't find an alternative call for the deprecated constructor. Here's the code: private String AccessKeyID = "xxxxxxxxxxxxxxxxxxxx"; private String…
Asif Ali
  • 1,422
  • 2
  • 12
  • 28
70
votes
9 answers

No RegionEndpoint or ServiceURL configured

I am writing code to upload files to AWS S3 and receiving this exception: AmazonClientException: No RegionEndpoint or ServiceURL configured My code: Console.WriteLine("ready to upload"); AWSCredentials credentials; credentials = new…
xiehongguang
  • 1,274
  • 1
  • 10
  • 24
68
votes
3 answers

Mock a dependency's constructor Jest

I'm a newbie to Jest. I've managed to mock my own stuff, but seem to be stuck mocking a module. Specifically constructors. usage.js const AWS = require("aws-sdk") cw = new AWS.CloudWatch({apiVersion: "2010-08-01"}) ... function myMetrics(params) { …
Oliver Shaw
  • 5,235
  • 4
  • 26
  • 35
65
votes
4 answers

How to get the region of the current user from boto?

Problem: I'm trying to get the region of the authenticated user from boto3. Use case: I'm working on adding cache to https://github.com/pmazurek/aws-fuzzy-finder. I would prefer to cache the result on per-region basis. This package uses boto to get…
Piotr Mazurek
  • 1,083
  • 1
  • 8
  • 14
60
votes
8 answers

How to use the code returned from Cognito to get AWS credentials?

Right now, I'm struggling to understand AWS Cognito so maybe someone could help me out. I set a domain to serve Cognito's hosted UI for my User Pool like what's described here. So when I go to…
arjabbar
  • 6,044
  • 4
  • 30
  • 46
59
votes
5 answers

How to specify AWS credentials in C# .NET core console program

I am trying to test a .NET core console program to publish a message to SNS. As I had issues trying to get it to work in Lambda, I want to try it in a non-Lambda environment. In Lambda, security is covered by the role, but in a console program, I…
NealWalters
  • 17,197
  • 42
  • 141
  • 251
57
votes
4 answers

AWS CLI S3: copying file locally using the terminal : fatal error: An error occurred (404) when calling the HeadObject operation

I'm trying to copy files locally from s3 bucket. I can get the list of files on my bucket: aws s3 ls s3://myBucket/myDirectory/todaysFiles/ But when I try to copy the files locally: aws s3 cp s3://myBucket/myDirectory/todaysFiles/ . I get this…
user2924482
  • 8,380
  • 23
  • 89
  • 173
57
votes
3 answers

AWS lambda invoke not calling another lambda function - Node.js

After giving all the rights to invoke function. My Lambda function is not able to invoke another function . Every time I am getting timeout having 30 seconds timeout issue. It looks like lambda is not able to get another lambda function My lambdas…
Arpit Vaishnav
  • 4,739
  • 6
  • 39
  • 57
56
votes
6 answers

Simple file upload to S3 using aws-sdk and Node/Express

I am at a loss of what I am doing wrong, here is what I have: HTML
abritez
  • 2,616
  • 3
  • 29
  • 36
54
votes
6 answers

How to copy/move all objects in Amazon S3 from one prefix to other using the AWS SDK for Node.js

How do I copy all objects from one prefix to other? I have tried all possible ways to copy all objects in one shot from one prefix to other, but the only way that seems to work is by looping over a list of objects and copying them one by one. This…
Yousaf
  • 841
  • 1
  • 7
  • 15
52
votes
3 answers

How to query DynamoDB by date (range key), with no obvious hash key?

I need to keep local data on an iOS app in sync with data in a DynamoDB table. The DynamoDB table is ~2K rows, with only a hash key (id), and the following attributes: id (uuid) lastModifiedAt (timestamp) name latitude longitude I am currently…
James Skidmore
  • 49,340
  • 32
  • 108
  • 136
52
votes
4 answers

Streaming file from S3 with Express including information on length and filetype

Using the aws-sdk module and Express 4.13, it's possible to proxy a file from S3 a number of ways. This callback version will return the file body as a buffer, plus other relevant headers like Content-Length: function(req,res){ var s3 = new…
NChase
  • 1,638
  • 4
  • 22
  • 25
52
votes
5 answers

User is not authorized to perform: dynamodb:PutItem on resource

I am trying to access DynamoDB from my Node app deployed on AWS ElasticBeanStalk. I am getting an error User is not authorized to perform: dynamodb:PutItem on resource It works perfectly fine locally, but when I deploy to the AWS it stops…
51
votes
6 answers

AWS Java SDK - AWS authentication requires a valid Date or x-amz-date header

Getting the following exception when using the AWS SDK for Java and Java 1.8u60+. com.amazonaws.services.s3.model.AmazonS3Exception: AWS authentication requires a valid Date or x-amz-date header (Service: Amazon S3; Status Code: 403; Error Code:…
Andrew Shore
  • 1,391
  • 1
  • 9
  • 7
48
votes
0 answers

swf respondDecisionTaskCompleted call, response time degrade overtime

We have a decided worker running and as the time goes we noticed the response time of the respondDecisionTaskCompleted call was getting slower and slower. We tried using the same instance of SWF client as well as creating new instance of the client…
Eatdoku
  • 6,569
  • 13
  • 63
  • 98