Questions tagged [aws-sdk]
The software development kit for use with the Amazon Web Services API.
5,825
questions
-1
votes
0
answers
14
views
Is there a way to create an IAM role & IAM Policy programatically using aws-sdk (in an UI)?
I'm trying to create users/IAM Roles/IAM Policies programatically.
Creating users can be achieved using AWS Cognito using aws-sdk.
Here is the scenario:
Creating the first cognito user on AWS Console ...
0
votes
0
answers
14
views
Is there a way to keep a updated list of AWS Policy services, actions and condition keys?
I know there are web documentation for such resources (https://docs.aws.amazon.com/service-authorization/latest/reference/reference_policies_actions-resources-contextkeys.html)
But Is there a way to ...
0
votes
0
answers
15
views
Check if user/role has read/write permission on S3 bucket using AWS SDK
I am using the AWS SDK for .NET to upload files to S3. If the provided user/role credentials do not have permission to write to the bucket, the upload will fail.
Using the AWS SDK, is there a way to ...
0
votes
0
answers
18
views
AWS S3 - Bulk deletion via Java SDK v1
Is there any way to do a bulk delete in the v1 AWS SDK that does the same as this CLI call?
$ aws s3 rm s3://my-bucket --dryrun --recursive --exclude "*" --include "PREFIX_0/*"
(...
0
votes
0
answers
12
views
Failed to get item from dynamoDB using GetItemCommand (JS)
I am new to dynamoDB and trying to perform some basic operations to learn the subject.
I have successfully created a table using AWS SDK (so no credentials issue) like this:
const newTable = async ...
0
votes
1
answer
16
views
Unable to Read File After Promise That Writes the File has Resolved
My code takes a file from S3 and copies it to my local directory. It is then supposed to read the file and print its contents to the console.
I've wrapped the section of code that copies the file in a ...
0
votes
1
answer
35
views
Only one message is received from SQS ( nodejs aws sdk)
I created an SQS with default settings. I published two messages to it, and I would like to read them back in the same time. I tried it like this:
const sqsClient = new SQSClient({ region: REGION });
...
0
votes
0
answers
55
views
Error when calling AWS Lambda from PHP script hosted on Apache but can from same script run directly
I have a PHP (8.1.8) page hosted on Apache (2.4) on a Windows Server 2019 EC2 instance in AWS. It attempts to send an event to a Lambda Function. The page is called with HTTP, not HTTPS (don't ask - ...
0
votes
0
answers
20
views
How to use regex to match key in "GetObjectCommand" from "@aws-sdk/client-s3@3.142.0"?
import { S3Client, GetObjectCommand, S3ClientConfig } from "@aws-sdk/client-s3";
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
const s3Configuration: ...
0
votes
1
answer
30
views
NodeJS API Async/Await issue: AWS SDK
Thank you for taking time to read this post. I am struggling to get AWS API call working with nodejs API using await.
Below is my sample application which when run without the AWS SDK call works as ...
0
votes
1
answer
35
views
Start execution of existing SageMaker pipeline using Python SDK
SageMaker documentatin explains how to run a pipeline, but it assumes I have just defined it and I have the object pipeline available.
How can I run an existing pipeline with Python SDK?
I know how to ...
0
votes
1
answer
49
views
How do you send an email using a template with AWS SES Java SDK sesv2
I'm trying to send an email using a template with the AWS Java SDK v2 2.17.235. I have created the template and read at least 2 dozen pages of documentation at this point. 6 hours in I have not been ...
1
vote
0
answers
33
views
Generate presigned URL with Quarkus
I am facing a problem when I try to generate a presigned url to GET file from AWS S3 with AWS SDK in Quarkus.
<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>The ...
0
votes
1
answer
26
views
Work around DynamoDb Transaction Conflict Exception
My model represents users with unique names. In order to achieve that I store user and its name as 2 separate items using TransactWriteItems. The approximate structure looks like this:
PK ...
0
votes
0
answers
12
views
AWS CloudSearch JSON in POST request instead of static JSON file
As per AWS docs , we need to provide a json file (that contains the data) for uploading the data through Document Service Endpoint. But, can I create a POJO object instead and send a POST request ...
0
votes
0
answers
32
views
How to mock aws-sdk using jest mock, getting error "Missing region in config"
I am trying to mock aws-sdk in jest.
I have below code in <root>\utils\jest\__mocks__\mock-aws-sdk.js.
const AWS = require('aws-sdk');
jest.mock('aws-sdk', () => ({
config: {
update: ...
0
votes
1
answer
65
views
I am exploring the Incremental Learning feature in Amazon Sagemaker
I have access to AWS Console and started exploring the Sagemaker Incremental Learning documentation. It is mentioned that only three built-in algorithms currently support incremental training: Object ...
0
votes
0
answers
12
views
Unable to get AWS/SDK S3 CreateReadStream to work right
I've tried a million iterations of this, and I figure I'll ask the experts now.
I simply want to read a file from AWS S3 and write it to a file using a stream. This is in a Lambda function.
I've ...
0
votes
1
answer
35
views
How to check if fargate instance is already running
How do I check if an AWS Fargate instance is already running in golang?
I was thinking of providing a name in the config so when you try to start another instance with one already running it doesn't ...
0
votes
1
answer
17
views
BadRequestException when trying to access serverless database cluster via its Data API inside a Lambda
My Lambda function has exactly the same IAM permissions as an IAM user I created for testing purposes. When I configure the AWS CLI on my local computer to use the IAM user and execute the following ...
0
votes
1
answer
24
views
AWS SDK: Start new task and connect it to the service
I have product on AWS ECS Fargate. I need to write a small console application which will restart task on it remotely.
I wrote small application in C# and I'm using AWS SDK nuggets. My algorithm is:
...
0
votes
0
answers
35
views
Amazon Lex SDK only running one command
I am attempting to use the AWS SDK version 3 and the Lex Runtime client V2. (Documentation)
What I don't understand is why can I not reuse my client instance to send multiple commands? See the code ...
0
votes
1
answer
39
views
Upload file to a specific folder - AWS S3
I am trying to upload a file from Node.js application to AWS S3 Bucket.
async uploadFile(file: any) {
try {
console.log(file);
const s3Params = {
Bucket: xyz,
Key: ...
0
votes
1
answer
20
views
AWS Textract with Angular TS. I am trying to connect aws textract with angular through aws-sdk/client-textract npm package.But I get Credentialerror
Here is my app.component.ts.I have imported aws-sdk/client-textract in app.component.ts and
given region of my textract I donot know where to give my access_key and secret_key and also what are ...
-1
votes
1
answer
49
views
how to update secrets manager secret value from lambda function?
I have a access token retrieved from an api and its lifetimes is 5 hours. I saw that secrets manager can rotate a secret but minimum rotation time is 1 day. Because of this i thought that i can write ...
0
votes
0
answers
34
views
AWS SDK configuration doesn't work on Angular application running on EC2 with instance profile role?
We are have angular application running on EC2 with instance profile role.
In angular application we have use aws-sdk to fetch some details of EC2.
It is giving error "Missing credentials in ...
0
votes
0
answers
24
views
GetMetricStatistics returns empty datapoints list in AWS SDK for Go (V2)
I am trying to use GetMetricStatistics function in AWS SDK for Go (V2) to calculate average CPU utilization for an Ec2. However, there are no datapoints in response at all.
I tried implementing the ...
0
votes
0
answers
43
views
Authenticating with AWS AssumedRole in JS AWS SDK v3
I'm having problems understanding how authentication is supposed to work in AWS SDK v3. My use case requires me to provide temporary credentials generated on the backend to the frontend app (js, ...
1
vote
0
answers
27
views
AWS Cognito - ResourceNotFoundException and GroupExistsException in test cases
I'm writing test cases that repeatedly call CreateGroup, UpdateGroup and DeleteGroup for AWS Cognito and validate if these changes were successful by reading the respective group via GetGroup via the ...
0
votes
1
answer
24
views
Connect to elasticfilesystem.ap-south-1.amazonaws.com:80 failed: Connection refused From Java SDK
I try to connect Aws EFS using Java Aws sdk. But its Giving Me Error.*
Unable to execute HTTP request: Connect to
elasticfilesystem.ap-south-1.amazonaws.com:80
[elasticfilesystem.ap-south-1.amazonaws....
0
votes
1
answer
28
views
Cannot destructure property 'Sha256' of 'sha256_js_1.default' as it is undefined
I am currently doing some work on a AWS-Lambda and as part of that project I am using "@aws-crypto/sha256-js" in my project.
When I bring in Sha256 as per the Amplify documentation https://...
0
votes
2
answers
67
views
How to fix AWS 403 error "Check your AWS Secret Access Key and signing method" when calling SES listcontacts
I have been stuck for about the past 6 hours at this point I'm thinking the only reasonable explanations are that this is a AWS SDK bug or the error message is wrong.
I am using SESv2 class from the ...
-5
votes
0
answers
40
views
Aws Iot with Angular
I would like to integrate AWS IoT into my Angular Application.
Can anyone help me with that?
I have tried this code on app.compoenent.ts
import * as awsIot from 'aws-iot-device-sdk';
const device =...
0
votes
0
answers
25
views
Detect Bounced Emails using SMTP [AWS SES]
I setup SMTP Interface in AWS SES, and using the SMTP credentials, I am sending mails to verified mailIds. The code to send the mail is the basic smtp snippet which is as follows:
try:
server = ...
0
votes
0
answers
18
views
Amazon Connect SDK (describeUser) is not working with some user
I am using Amazon Connect SDK to describe connect users and it works fine but gives errors with some amazon connect users. I am not sure why this is happening.
here is the SDK that I am using
var ...
0
votes
1
answer
42
views
Return URL from file uploaded to AWS S3
I have a function that makes an API request containing the URL of a new file I just uploaded to AWS S3.
And I have one function that only upload the file to S3.
I am having issues with returning this ...
1
vote
1
answer
22
views
Upload video from react native to aws using aws-sdk
Note: working great with image
Below is the code to select image/video
await launchImageLibrary(options, response => {
if (response.didCancel) {
} else if (response.error) {
} else if (...
1
vote
1
answer
148
views
check AmazonS3 for empty object
@Component
public class AwsS3Client {
private AmazonS3 amazonS3;
public AmazonS3 getAmazonS3() {
return this.amazonS3;
}
}
......
@Autowired
private AwsS3Client awsS3Client;
...
0
votes
1
answer
30
views
How to upgrade commons-codec 1.11 used by aws-sdk:ssm in gradle Java
As part of security scan this vulnerability is shown with commons-codec 1.11 (which needs to be upgraded with 1.13), but this dependency is pulled down by aws-sdk:ssm -> httpclient -> commons-...
1
vote
2
answers
167
views
AWS Error "Calling the invoke API action failed with this message: Rate Exceeded" when I use s3.get_paginator('list_objects_v2')
Some third party application is uploading around 10000 object to my bucket+prefix in a day. My requirement is to fetch all objects which were uploaded to my bucket+prefix in last 24 hours.
There are ...
0
votes
1
answer
37
views
Is storing ARNs the correct way to register and send to AWS SNS?
I'm trying to implement push notifications via AWS SNS using FCM/APNS. I've successfully done it manually via the SNS console and now I'm trying to implement the whole process via Java.
The tutorials ...
0
votes
0
answers
4
views
How to replace `JsonMarshaller` with `DynamoDBTypeConvertedJson` in aws-sdk 1.12.245?
I am helping my team updating our service which is currently using some deprecated aws-sdk feature
some of our code is using JsonMarshaller :
public abstract class SomeTaskClass {
...
@...
0
votes
2
answers
33
views
Java AWS S3 SDK2 how to perform async bulk operations
I'd like to perform bulk operations within S3 asynchronously. For some reason, I could not find a way of doing that in the new SDK2 client built by AWS. I currently use the S3AsyncClient's putObject ...
1
vote
2
answers
30
views
Issuing uploading file to Amazon S3 Bucket. using the AWS SDK for Java v2
I am trying to upload a file to an AWS S3 Bucket using the AWS SDK 2.0 for Java, but I am getting an error when trying to do so.
software.amazon.awssdk.services.s3.model.S3Exception: The request ...
-1
votes
1
answer
27
views
Connect to AWS without using static credentials
I am using aws-go sdk
using static creds I am able to connect using
config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(awsAccesstKey, awsSecretKey, "")),
is there ...
0
votes
1
answer
24
views
How to set or get data from elasticache using aws-sdk methods
I am trying get data from redis using aws-sdk in node js. so far I am able to connect with the cache using client-elasticache.
redisClient = new ElastiCacheClient({region : "REGION"});
...
0
votes
1
answer
107
views
How to calculate SHA-256 checksum of S3 file content in memory
I'm looking to compute the sha256 checksum of an image file located in S3 without writing it to disk.
I have tried the code below:
const data = (
await getS3().getObject({ Bucket: bucketName, ...
0
votes
0
answers
9
views
Create read stream from Buffer for uploading to s3 [duplicate]
I have a large Buffer object and when I upload to S3, but it throw
Connection timed out after 120000ms
When I uploaded with smaller size file, it's work, I did the research and they said that for ...
6
votes
2
answers
102
views
Alternate for EC2MetadataUtils
In our code, to get the ec2 instance's region we are using EC2MetadataUtils.getEC2InstanceRegion(), and we just realized we must not use EC2MetadataUtils because it is an internal API that is subject ...
0
votes
0
answers
13
views
Issue creating AmazonS3Client with credentials
I have .NET Standard 2.0 library that is shared with .NET Framework 4.7.2 and NET 5 applications.
For brevity purpose some code is removed
In .NET Standard 2.0 common library I have the following code....