Class Stream.Builder

java.lang.Object
software.amazon.awscdk.services.kinesis.Stream.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<Stream>
Enclosing class:
Stream

@Stability(Stable) public static final class Stream.Builder extends Object implements software.amazon.jsii.Builder<Stream>
A fluent builder for Stream.
  • Method Details

    • create

      @Stability(Stable) public static Stream.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of Stream.Builder.
    • encryption

      @Stability(Stable) public Stream.Builder encryption(StreamEncryption encryption)
      The kind of server-side encryption to apply to this stream.

      If you choose KMS, you can specify a KMS key via encryptionKey. If encryption key is not specified, a key will automatically be created.

      Default: - StreamEncryption.KMS if encrypted Streams are supported in the region or StreamEncryption.UNENCRYPTED otherwise. StreamEncryption.KMS if an encryption key is supplied through the encryptionKey property

      Parameters:
      encryption - The kind of server-side encryption to apply to this stream. This parameter is required.
      Returns:
      this
    • encryptionKey

      @Stability(Stable) public Stream.Builder encryptionKey(IKey encryptionKey)
      External KMS key to use for stream encryption.

      The 'encryption' property must be set to "Kms".

      Default: - Kinesis Data Streams master key ('/alias/aws/kinesis'). If encryption is set to StreamEncryption.KMS and this property is undefined, a new KMS key will be created and associated with this stream.

      Parameters:
      encryptionKey - External KMS key to use for stream encryption. This parameter is required.
      Returns:
      this
    • retentionPeriod

      @Stability(Stable) public Stream.Builder retentionPeriod(Duration retentionPeriod)
      The number of hours for the data records that are stored in shards to remain accessible.

      Default: Duration.hours(24)

      Parameters:
      retentionPeriod - The number of hours for the data records that are stored in shards to remain accessible. This parameter is required.
      Returns:
      this
    • shardCount

      @Stability(Stable) public Stream.Builder shardCount(Number shardCount)
      The number of shards for the stream.

      Can only be provided if streamMode is Provisioned.

      Default: 1

      Parameters:
      shardCount - The number of shards for the stream. This parameter is required.
      Returns:
      this
    • streamMode

      @Stability(Stable) public Stream.Builder streamMode(StreamMode streamMode)
      The capacity mode of this stream.

      Default: StreamMode.PROVISIONED

      Parameters:
      streamMode - The capacity mode of this stream. This parameter is required.
      Returns:
      this
    • streamName

      @Stability(Stable) public Stream.Builder streamName(String streamName)
      Enforces a particular physical stream name.

      Default:

      Parameters:
      streamName - Enforces a particular physical stream name. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public Stream build()
      Specified by:
      build in interface software.amazon.jsii.Builder<Stream>
      Returns:
      a newly built instance of Stream.