Class LogStream.Builder

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

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

    • create

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

      @Stability(Stable) public LogStream.Builder logGroup(ILogGroup logGroup)
      The log group to create a log stream for.

      Parameters:
      logGroup - The log group to create a log stream for. This parameter is required.
      Returns:
      this
    • logStreamName

      @Stability(Stable) public LogStream.Builder logStreamName(String logStreamName)
      The name of the log stream to create.

      The name must be unique within the log group.

      Default: Automatically generated

      Parameters:
      logStreamName - The name of the log stream to create. This parameter is required.
      Returns:
      this
    • removalPolicy

      @Stability(Stable) public LogStream.Builder removalPolicy(RemovalPolicy removalPolicy)
      Determine what happens when the log stream resource is removed from the app.

      Normally you want to retain the log stream so you can diagnose issues from logs even after a deployment that no longer includes the log stream.

      The date-based retention policy of your log group will age out the logs after a certain time.

      Default: RemovalPolicy.Retain

      Parameters:
      removalPolicy - Determine what happens when the log stream resource is removed from the app. This parameter is required.
      Returns:
      this
    • build

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