Amazon Kinesis Construct Library
This is a developer preview (public beta) module.
All classes with the Cfn
prefix in this module (CFN Resources)
are auto-generated from CloudFormation. They are stable and safe to use.
However, all other classes, i.e., higher level constructs, are under active development and subject to non-backward
compatible changes or removal in any future version. These are not subject to the Semantic Versioning model.
This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.
Define an unencrypted Kinesis stream.
new Stream(this, 'MyFirstStream');
Encryption
Define a KMS-encrypted stream:
const stream = new Stream(this, 'MyEncryptedStream', {
encryption: StreamEncryption.Kms
});
assert(stream.encryptionKey instanceof kms.Key);
You can also supply your own key:
const myKmsKey = new kms.Key(this, 'MyKey');
const stream = new Stream(this, 'MyEncryptedStream', {
encryption: StreamEncryption.Kms,
encryptionKey: myKmsKey
});
assert(stream.encryptionKey === myKmsKey);