- Newest
- Most votes
- Most comments
Hello.
You may need to install the "AWS CRT extension" as described in the document below.
https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/eventbridge-examples.html
To use EventBridge global endpoints with the SDK for PHP, your PHP environment must have the AWS Common Runtime (AWS CRT) extension installed.
Please check the installation method on GitHub below.
https://github.com/awslabs/aws-crt-php#aws-common-runtime-php-bindings
I also think you're encountering an authentication issue with your AWS SDK for PHP when trying to put events to the EventBridge bus. The error message indicates that the operation requests sigv4a authentication schemes, but the client only supports sigv4, none, bearer, sigv4-s3express.
To resolve this issue, you may need to configure your AWS SDK for PHP to use Signature Version 4 (sigv4) authentication scheme explicitly. Here's how you can modify your code to specify the authentication scheme:
require_once(DIR.'/vendor/autoload.php');
use Aws\EventBridge\EventBridgeClient; use Aws\Credentials\Credentials; use Aws\Signature\SignatureV4;
// Specify your AWS credentials $credentials = new Credentials('YOUR_ACCESS_KEY_ID', 'YOUR_SECRET_ACCESS_KEY');
// Specify the AWS region and authentication scheme $config = [ 'region' => 'us-east-1', 'version' => 'latest', 'signature' => new SignatureV4('eventbridge', 'us-east-1') ];
// Create an EventBridge client with the specified configuration $evClient = new EventBridgeClient($config + ['credentials' => $credentials]);
// Your code to put events to the EventBridge bus goes here
Codebase updated: require_once(DIR . '/vendor/autoload.php');
use Aws\EventBridge\EventBridgeClient; use Aws\Credentials\Credentials; use Aws\Signature\SignatureV4;
$credentials = new Credentials('YOUR_ACCESS_KEY_ID', 'YOUR_SECRET_ACCESS_KEY');
$evClient = new EventBridgeClient([ 'region' => 'us-east-1', 'version' => 'latest', 'signature' => new SignatureV4('eventbridge', 'us-east-1'), 'credentials' => $credentials ]);
Still same exception. Any ideas?
Relevant content
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
Thank you guys. Installing AWS CRT did not work