Questions tagged [aws-php-sdk]

Amazon Web Services SDK for PHP

The AWS SDK for PHP enables PHP developers to easily work with Amazon Web Services and build scalable solutions with Amazon S3, Amazon DynamoDB, Amazon Glacier, and more.

Download Link

User Guide

API Documentation

314 questions
3
votes
1 answer

Overwriting retries / retry decider for individual calls in AWS SDK

Is there a way of overwriting retries for an individual call in AWS SDK for PHP? The following code explains the question: // Create client with a default of 2 retries $sqsClient = new sqsClient('2012-11-05', ['retries' => 2]); // This will retry…
Robbie
  • 17,605
  • 4
  • 35
  • 72
3
votes
1 answer

DynamoDB List data-type issue

According this doc, DynamoDB supports map (M) and list (L) types, but when I'm trying to create a table with (L) type, I'm getting an error: ValidationException (client): 1 validation error detected: Value 'L' at…
Roman Newaza
  • 11,405
  • 11
  • 58
  • 89
3
votes
2 answers

Error on instantiating class extended from AwsClient subclass

I'm extending my custom Sqs class like this: class Sqs extends SqsClient { public function __construct() { parent::__construct(array( 'credentials' => array( 'key' => $_ENV['AWS_ACCESS_KEY_ID'], …
Sam Malayek
  • 3,595
  • 3
  • 30
  • 46
3
votes
2 answers

How to set http timeouts for Amazon AWS SDK for PHP

I'm using the Amazon AWS SDK for PHP (namely, version 2.7.16) to upload files to an S3 bucket. How can I set a timeout for http/tcp operations (connection, upload, etc.)? Although I've googled a lot I wasn't able to find out how. Sample code I'm…
mmanzato
  • 213
  • 3
  • 8
3
votes
2 answers

how to use if_not_exists() for a key of a map in Dynamodb's updateItem() in PHP API

thank you for your time first! The map: Country:{ Sweden: 3, US: 4, UK: 9 } How could I check if the country name exists in the map, if not then creating it and set it to a default value. For example, Spain is not in the map, how could I use…
Spider
  • 1,380
  • 4
  • 22
  • 42
3
votes
2 answers

Retrieving headers for streaming object using AWS SDK for PHP (v3)

A guide exists for v2 of the AWS SDK for PHP to stream objects, like an image, from S3. In that guide, it references $command->getResponse()->getHeaders() - both getResponse() and getHeaders() do not seem to exist in v3 of the SDK. The documentation…
Luke Shaheen
  • 4,262
  • 12
  • 52
  • 82
3
votes
1 answer

AWS S3 uploaded images are getting corrupted

I am working on AWS ec2 ubuntu machine. My code is in cakephp. When I try to upload any image to AWS S3 it will get corrupted. while it is working fine in core php code. here is my controller code if ($this->User->saveAll($this->request->data)) { …
urfusion
  • 5,528
  • 5
  • 50
  • 87
3
votes
1 answer

Call to S3Client::setRegion() fails

I'm using "aws/aws-sdk-php": "3.0.3" via composer to access some S3 buckets in different regions, but I can't seem to get S3Client to change regions using the setRegion() function without it generating the error: PHP Catchable fatal error: …
Sammitch
  • 30,782
  • 7
  • 50
  • 77
3
votes
1 answer

AWS PHP SDK upload file to S3 confusing errors

Ok, so I have tried several methods of getting a file to upload to my S3 account. Finally found myself getting somewhere and BOOM - confusing documentation and strange error messages which appear to contradict themselves. Ok, to start with I am not…
JustSteveKing
  • 968
  • 1
  • 10
  • 29
2
votes
2 answers

Set AWS SQS visibility timeout for a message when creating the message

I am using the AWS SDK for PHP to push a message into an AWS SQS queue. I'd like to be able to set the visibility timeout for specific messages to be different than the default. It would make sense to be able to do that, but I can't find a way to do…
crmpicco
  • 16,605
  • 26
  • 134
  • 210
2
votes
3 answers

How is it possible to get instance metadata using PHP AWS SDK?

I would like to get the instance metadata (like AZ) for the current EC2, using AWS SDK. I was able to find an alternative solution, but it is not using the SDK just a file_get_contents How is it possible with the SDK?
Iter Ator
  • 8,226
  • 20
  • 73
  • 164
2
votes
0 answers

How to generate ASW s3 presigned URl from php and then upload multiple files in that url from javascript?

I want to upload multiple files from browser with axios into s3 bucket. I am using aws-sdk-php library in laravel. My intention is when I want to upload one or multiple files, I will send a GET request to backend(laravel) for a presigned URL. After…
2
votes
0 answers

How to setup SQS to work using AWS Instance Profile instead of `key` and `secret`?

I am trying to setup SQS to use AWS Instance Profile instead of key and secret using Laravel 8. I have tried the following in queue.php 'sqs' => [ 'driver' => 'sqs', 'credentials' =>…
ocind
  • 149
  • 1
  • 13
2
votes
1 answer

【AWS SDK PHP】Unable to access SecretsManager from ECS by IAM role

I have a php application running on ECS Fargate 1.14. aws-sdk-php version is 3. I want to get secret value stored in AWS SecretsManager by IAM Role, not by AWS Access key/ID for a security reason. I set SecretsManagerClient like this. $config = [ …
rfujino
  • 31
  • 4
2
votes
2 answers

AWS Lambda send SMS via AWS-PHP-SDK doesn't work

Problem description: I am unable to send SMS from AWS Lambda. Controller Code try { $sms = AwsFacade::createClient('sns'); $result = $sms->publish([ 'MessageAttributes' => [ 'AWS.SNS.SMS.SenderID' =>…
CyQuer
  • 21
  • 2