Skip to content

Instantly share code, notes, and snippets.

@fndiaz
Last active September 27, 2018 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fndiaz/e681607e6be84fe76a0f386a46a0627e to your computer and use it in GitHub Desktop.
Save fndiaz/e681607e6be84fe76a0f386a46a0627e to your computer and use it in GitHub Desktop.
Conector php for Firehose Stream AWS
<?php
use Aws\Firehose\FirehoseClient;
// Install deps with `composer install`
require 'vendor/autoload.php';
$firehose = new FirehoseClient([
'version' => 'latest',
'region' => 'us-east-1',
'credentials' => [ // OR set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env vars
'key' => 'key',
'secret' => 'accesskey'
],
]);
$result = $firehose->putRecord([
'DeliveryStreamName' => 'teste-php',
'Record' => [
'Data' => '{"datetime": "2018-07-11T18:51:27", "status": "ERR", "id": "(3):", "msg": "teste firehose php2"}'
]
]);
echo $result
?>
apt-get install mcrypt php7.0-mcrypt
apt-get install php-mbstring
apt-get install phpunit
curl -sS https://getcomposer.org/installer | php
php composer.phar require aws/aws-sdk-php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment