-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages from @ a8b21d2 🚀
- Loading branch information
Showing
3 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* This file demonstrates the process of creating a Kinesis Video Stream. | ||
*/ | ||
async function createStream(formValues) { | ||
try { | ||
console.log( | ||
'[CREATE_STREAM] Attempting to create a Kinesis Video Stream with name', | ||
formValues.streamName, | ||
'with', | ||
formValues.retentionInHours, | ||
'hours of retention.', | ||
); | ||
// Create KVS client | ||
const kinesisVideoClient = new AWS.KinesisVideo({ | ||
region: formValues.region, | ||
accessKeyId: formValues.accessKeyId, | ||
secretAccessKey: formValues.secretAccessKey, | ||
sessionToken: formValues.sessionToken, | ||
endpoint: formValues.endpoint, | ||
}); | ||
|
||
const createStreamResponse = await kinesisVideoClient | ||
.createStream({ | ||
StreamName: formValues.streamName, | ||
DataRetentionInHours: formValues.retentionInHours, | ||
}) | ||
.promise(); | ||
|
||
console.log('[CREATE_STREAM] Success! Stream ARN:', createStreamResponse.StreamARN); | ||
} catch (e) { | ||
console.error('[CREATE_STREAM] Encountered error:', e); | ||
} | ||
} |
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