-
-
Save prasad0552/0072e50113086906ee1c8338fc98f00b to your computer and use it in GitHub Desktop.
Firehose example
This file contains hidden or 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' => 'eu-west-1', | |
'credentials' => [ // OR set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env vars | |
'key' => 'abc', | |
'secret' => '123' | |
], | |
]); | |
$firehose->putRecord([ | |
'DeliveryStreamName' => 'streamName', | |
'record' => [ | |
'Data' => "Streaming data to Amazon S3 via Amazon Kinesis Firehose is easy.\n" | |
] | |
]); | |
// OR | |
$firehose->putRecordBatch([ | |
'DeliveryStreamName' => 'streamName', | |
'records' => [ | |
[ | |
'Data' => "Streaming data to Amazon S3 via Amazon Kinesis Firehose is easy.\n" | |
], | |
// ['Data' => "..."], ... | |
] | |
]); |
This file contains hidden or 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
{ | |
"require": { | |
"aws/aws-sdk-php": "^3.22" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment