Last active
February 8, 2022 03:11
-
-
Save JasonReading/6227a44b7afd1498b0b517d7b6c19fea to your computer and use it in GitHub Desktop.
Firehose example
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' => '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 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