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
21
votes
4 answers

AWS - import JSON file to load Dynamo table

I have a json file that I want to use to load my Dynamo table in AWS. In the AWS console, there is only an option to create one record at a time. Not good: ) Essentially my .JSON file is an array of objects which hold the data for each column in…
29er
  • 8,595
  • 12
  • 48
  • 65
21
votes
6 answers

How to run AWS SDK with credentials from variables?

I used environment variables before and it worked fine. Now I am migrating my config variables into a single file and I have AWS_SECRET_ACCESS_KEY and AWS_ACCESS_KEY_ID variables containing respective values that are loaded from this file. I tried…
Sergei Basharov
  • 51,276
  • 73
  • 200
  • 335
21
votes
1 answer

AWS API Get Any Resource By ARN

I have a bunch AWS resource ARNs. I can easily write a switch/case statement on the namespace of the ARN and call the appropriate describeXYZ method on the correct AWS API class to get the resource details. But is there a way of taking any arbitrary…
Jeff
  • 35,755
  • 15
  • 108
  • 220
21
votes
6 answers

An exception "The Content-MD5 you specified did not match what we received"

I got an exception, I never got before when testing my application that uploads a file from ec2 to s3. The content is: Exception in thread "Thread-1" com.amazonaws.services.s3.model.AmazonS3Exception: The Content-MD5 you specified did not match what…
Joey
  • 549
  • 1
  • 4
  • 7
21
votes
4 answers

AWS IOT - Credential should be scoped to correct service

I am trying to access a simple AWS IOT REST service but I have not been able to do so successfully yet. Here is what I did. I created an iam user in my aws and downloaded the access key and secret key Logged into AWS IOT with that user and created…
Robby
  • 371
  • 2
  • 3
  • 15
21
votes
4 answers

dynamoDB - Get multiple items from DB by array of primary keys

I have an array of users id's and I want to get all users with that id from the dynamoDB table Didn't find it in the documentation any ideas?
Shining Love Star
  • 5,734
  • 5
  • 39
  • 49
21
votes
2 answers

From AWS SDK, how to I get the current logged in username (or IAM user)?

I'm using the Ruby SDK (V2), but I guess my question is more general than the specific implementation as I couldn't find an answer in any of the SDKs. How do I get the username (and/or IAM user) that my session currently belongs to? I let the SDK…
Zach Moshe
  • 2,782
  • 4
  • 24
  • 40
21
votes
2 answers

S3 warning: "No content length specified for stream data"

I suddenly started seeing this warning message being logged, even though there were no changes in the usage of or on the underlying aws libs. I've been using aws-java-sdk version 1.6.9.1 No content length specified for stream data. Stream contents…
vaudeville
  • 321
  • 1
  • 2
  • 5
21
votes
6 answers

AWS was not able to validate the provided access credentials

I have been trying to create Security Group using AWS SDK, but somehow it fails to authenticate it. For the specific Access Key and Secret Key, i have provided the Administrative rights, then also it fails to validate. On the other side, I tried the…
Sunil Gulabani
  • 878
  • 1
  • 8
  • 21
20
votes
4 answers

Suppress AWS SDK v2 deprecation message

I am seeing an awful lot of this message: NOTE: The AWS SDK for JavaScript (v2) will be put into maintenance mode in 2023. Please migrate your code to use AWS SDK for JavaScript (v3). For more information, check the migration guide at…
Steve Bennett
  • 114,604
  • 39
  • 168
  • 219
20
votes
3 answers

NoClassDefFoundError: org/apache/hadoop/fs/StreamCapabilities while reading s3 Data with spark

I would like to run a simple spark job on my local dev machine (through Intellij) reading data from Amazon s3. my build.sbt file: scalaVersion := "2.11.12" libraryDependencies ++= Seq( "org.apache.spark" %% "spark-core" % "2.3.1", …
ogen
  • 802
  • 2
  • 7
  • 23
20
votes
3 answers

What are the benefits of cfn-init over userdata?

My CloudFormation template has gotten pretty long. One reason is because my AWS::CloudFormation::Init section has gotten pretty huge. This is a very small sample of what I have: "ConfigDisk": { "commands": { "01formatFS": { …
Sixty4Bit
  • 12,852
  • 13
  • 48
  • 62
19
votes
4 answers

'Credential is missing' Error On Instantiating S3 Class Using AWS-SDK JS V3

I am getting en error when creating S3 client from class S3 in newer v3 of aws-sdk javascript. I add aws config parameters including credentials obtained from aws sts when user gets authenticated (assuming a role with permission to call getObject)…
Waleed93
  • 1,130
  • 2
  • 15
  • 24
19
votes
4 answers

Type annotation for boto3 resources like DynamoDB.Table

The boto3 library provides several factory methods that returns resources. For example: dynamo = ( boto3 .resource('dynamodb') .Table(os.environ['DYNAMODB_TABLE']) ) I want to annotate those resources so I can get better type checking…
villasv
  • 6,304
  • 2
  • 44
  • 78
19
votes
2 answers

Invalid Bucket name when creating s3 bucket with AWS SDK

I tried to create a S3 bucket(thisIsTestBucket190) via AWS SDK (Node) and came across Invalid bucket name exception. { InvalidBucketName: The specified bucket is not valid. at Request.extractError…
Nirojan Selvanathan
  • 10,066
  • 5
  • 61
  • 82