Class LogGroupProps.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • dataProtectionPolicy

      @Stability(Stable) public LogGroupProps.Builder dataProtectionPolicy(DataProtectionPolicy dataProtectionPolicy)
      Parameters:
      dataProtectionPolicy - Data Protection Policy for this log group.
      Returns:
      this
    • encryptionKey

      @Stability(Stable) public LogGroupProps.Builder encryptionKey(IKey encryptionKey)
      Parameters:
      encryptionKey - The KMS customer managed key to encrypt the log group with.
      Returns:
      this
    • logGroupClass

      @Stability(Stable) public LogGroupProps.Builder logGroupClass(LogGroupClass logGroupClass)
      Parameters:
      logGroupClass - The class of the log group. Possible values are: STANDARD and INFREQUENT_ACCESS. INFREQUENT_ACCESS class provides customers a cost-effective way to consolidate logs which supports querying using Logs Insights. The logGroupClass property cannot be changed once the log group is created.
      Returns:
      this
    • logGroupName

      @Stability(Stable) public LogGroupProps.Builder logGroupName(String logGroupName)
      Parameters:
      logGroupName - Name of the log group.
      Returns:
      this
    • removalPolicy

      @Stability(Stable) public LogGroupProps.Builder removalPolicy(RemovalPolicy removalPolicy)
      Parameters:
      removalPolicy - Determine the removal policy of this log group. Normally you want to retain the log group so you can diagnose issues from logs even after a deployment that no longer includes the log group. In that case, use the normal date-based retention policy to age out your logs.
      Returns:
      this
    • retention

      @Stability(Stable) public LogGroupProps.Builder retention(RetentionDays retention)
      Parameters:
      retention - How long, in days, the log contents will be retained. To retain all logs, set this value to RetentionDays.INFINITE.
      Returns:
      this
    • build

      @Stability(Stable) public LogGroupProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<LogGroupProps>
      Returns:
      a new instance of LogGroupProps
      Throws:
      NullPointerException - if any required attribute was not provided