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'],
'secret' => $_ENV['AWS_SECRET_ACCESS_KEY'],
),
'region' => 'us-west-1',
'version' => 'latest'
));
}
}
And then I instantiate and use it like this:
$sqs = new Sqs();
$sqs->sendMessage([
'QueueUrl' => $_ENV['AWS_SQS_URL_PREFIX'] . '/' . $_ENV['AWS_SQS_READER_USER_CREATE'],
'MessageBody' => $user_json,
'MessageGroupId' => 1,
'MessageDeduplicationId' => uniqid(),
]);
But I'm getting a weird error:
The service \"\" is not provided by the AWS SDK for PHP.