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
    • deletionProtectionEnabled

      @Stability(Stable) public LogGroupProps.Builder deletionProtectionEnabled(Boolean deletionProtectionEnabled)
      Parameters:
      deletionProtectionEnabled - Indicates whether deletion protection is enabled for this log group. When enabled, deletion protection blocks all deletion operations until it is explicitly disabled.
      Returns:
      this
    • encryptionKey

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

      @Stability(Stable) public LogGroupProps.Builder fieldIndexPolicies(List<? extends FieldIndexPolicy> fieldIndexPolicies)
      Parameters:
      fieldIndexPolicies - Field Index Policies for this log group.
      Returns:
      this
    • logGroupClass

      @Stability(Stable) public LogGroupProps.Builder logGroupClass(LogGroupClass logGroupClass)
      Parameters:
      logGroupClass - The class of the log group. Possible values are: STANDARD, INFREQUENT_ACCESS and DELIVERY. 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.

      DELIVERY class is used to deliver logs to a destination such as Amazon S3 or Amazon Data Firehose (for example, Lambda vended logs). A Delivery log group forwards events to a destination instead of storing them, so it does not support retention, dataProtectionPolicy, or fieldIndexPolicies; setting any of these together with LogGroupClass.DELIVERY results in a synthesis-time error.

      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