Last active
September 27, 2018 20:24
-
-
Save fndiaz/e681607e6be84fe76a0f386a46a0627e to your computer and use it in GitHub Desktop.
Conector php for Firehose Stream AWS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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