Interface LogGroupProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
LogGroupProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.89.0 (build 2f74b3e)", date="2023-10-26T00:56:10.121Z") @Stability(Stable) public interface LogGroupProps extends software.amazon.jsii.JsiiSerializable
Properties for a LogGroup.

Example:

 import software.amazon.awscdk.services.kinesisfirehose.alpha.*;
 import software.amazon.awscdk.services.kinesisfirehose.destinations.alpha.*;
 LogGroup logGroupDestination = LogGroup.Builder.create(this, "LogGroupLambdaAudit")
         .logGroupName("auditDestinationForCDK")
         .build();
 Bucket bucket = new Bucket(this, "audit-bucket");
 S3Bucket s3Destination = new S3Bucket(bucket);
 DeliveryStream deliveryStream = DeliveryStream.Builder.create(this, "Delivery Stream")
         .destinations(List.of(s3Destination))
         .build();
 DataProtectionPolicy dataProtectionPolicy = DataProtectionPolicy.Builder.create()
         .name("data protection policy")
         .description("policy description")
         .identifiers(List.of(DataIdentifier.DRIVERSLICENSE_US, new DataIdentifier("EmailAddress")))
         .logGroupAuditDestination(logGroupDestination)
         .s3BucketAuditDestination(bucket)
         .deliveryStreamNameAuditDestination(deliveryStream.getDeliveryStreamName())
         .build();
 LogGroup.Builder.create(this, "LogGroupLambda")
         .logGroupName("cdkIntegLogGroup")
         .dataProtectionPolicy(dataProtectionPolicy)
         .build();
 
  • Method Details

    • getDataProtectionPolicy

      @Stability(Stable) @Nullable default DataProtectionPolicy getDataProtectionPolicy()
      Data Protection Policy for this log group.

      Default: - no data protection policy

    • getEncryptionKey

      @Stability(Stable) @Nullable default IKey getEncryptionKey()
      The KMS customer managed key to encrypt the log group with.

      Default: Server-side encrpytion managed by the CloudWatch Logs service

    • getLogGroupName

      @Stability(Stable) @Nullable default String getLogGroupName()
      Name of the log group.

      Default: Automatically generated

    • getRemovalPolicy

      @Stability(Stable) @Nullable default RemovalPolicy getRemovalPolicy()
      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.

      Default: RemovalPolicy.Retain

    • getRetention

      @Stability(Stable) @Nullable default RetentionDays getRetention()
      How long, in days, the log contents will be retained.

      To retain all logs, set this value to RetentionDays.INFINITE.

      Default: RetentionDays.TWO_YEARS

    • builder

      @Stability(Stable) static LogGroupProps.Builder builder()
      Returns:
      a LogGroupProps.Builder of LogGroupProps