renoki-co / aws-elastic-client
Just a simple Elasticsearch Client handler that signs the requests for AWS Elasticsearch service with the provided credentials.
Fund package maintenance!
rennokki
Installs: 38 880
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 3
Forks: 7
Open Issues: 2
Requires
- aws/aws-sdk-php: ^3.200
- guzzlehttp/guzzle: ^6.5|^7.3
- guzzlehttp/ring: ^1.1.1
- illuminate/support: ^8.83|^9.0.1
Requires (Dev)
- babenkoivan/elastic-client: ^1.2
- mockery/mockery: ^1.5
- orchestra/testbench: ^6.28|^7.0
- orchestra/testbench-core: ^6.28|^7.0
- phpunit/phpunit: ^9.5.13
This package is auto-updated.
Last update: 2024-11-23 20:26:30 UTC
README
Just a simple Elasticsearch Client handler that signs the requests for AWS Elasticsearch service with the provided credentials.
🤝 Supporting
If you are using one or more Renoki Co. open-source packages in your production apps, in presentation demos, hobby projects, school projects or so, sponsor our work with Github Sponsors. 📦
🚀 Installation
You can install the package via composer:
composer require renoki-co/aws-elastic-client
🙌 Usage
To authenticate to AWS, you will need to set the handler that comes with this package:
use RenokiCo\AwsElasticHandler\AwsHandler; $awsHandler = new AwsHandler([ 'enabled' => true, 'aws_access_key_id' => '...', 'aws_secret_access_key' => '...', 'aws_region' => 'us-east-1', 'aws_session_token' => '...', // optional ]); $client = ClientBuilder::create() ->setHosts(...) ->setHandler($awsHandler) ->build();
If you are building th client statically using fromConfig()
, pass the handler
parameter:
use RenokiCo\AwsElasticHandler\AwsHandler; $awsHandler = new AwsHandler([ 'enabled' => true, 'aws_access_key_id' => '...', 'aws_secret_access_key' => '...', 'aws_region' => 'us-east-1', 'aws_session_token' => '...', // optional ]); $client = ClientBuilder::fromConfig([ 'hosts' => [ // ], 'handler' => $awsHandler, ]);
The package will make sure to sign each subsequent request that goes through with the IAM credentials you have provided.
🐛 Testing
vendor/bin/phpunit
🤝 Contributing
Please see CONTRIBUTING for details.
🔒 Security
If you discover any security related issues, please email alex@renoki.org instead of using the issue tracker.