Class LogGroup.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<LogGroup>
- Enclosing class:
LogGroup
LogGroup
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
static LogGroup.Builder
dataProtectionPolicy
(DataProtectionPolicy dataProtectionPolicy) Data Protection Policy for this log group.encryptionKey
(IKey encryptionKey) The KMS customer managed key to encrypt the log group with.logGroupClass
(LogGroupClass logGroupClass) The class of the log group.logGroupName
(String logGroupName) Name of the log group.removalPolicy
(RemovalPolicy removalPolicy) Determine the removal policy of this log group.retention
(RetentionDays retention) How long, in days, the log contents will be retained.
-
Method Details
-
create
@Stability(Stable) public static LogGroup.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
LogGroup.Builder
.
-
dataProtectionPolicy
@Stability(Stable) public LogGroup.Builder dataProtectionPolicy(DataProtectionPolicy dataProtectionPolicy) Data Protection Policy for this log group.Default: - no data protection policy
- Parameters:
dataProtectionPolicy
- Data Protection Policy for this log group. This parameter is required.- Returns:
this
-
encryptionKey
The KMS customer managed key to encrypt the log group with.Default: Server-side encrpytion managed by the CloudWatch Logs service
- Parameters:
encryptionKey
- The KMS customer managed key to encrypt the log group with. This parameter is required.- Returns:
this
-
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.
Default: LogGroupClass.STANDARD
- Parameters:
logGroupClass
- The class of the log group. Possible values are: STANDARD and INFREQUENT_ACCESS. This parameter is required.- Returns:
this
-
logGroupName
Name of the log group.Default: Automatically generated
- Parameters:
logGroupName
- Name of the log group. This parameter is required.- Returns:
this
-
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.
Default: RemovalPolicy.Retain
- Parameters:
removalPolicy
- Determine the removal policy of this log group. This parameter is required.- Returns:
this
-
retention
How long, in days, the log contents will be retained.To retain all logs, set this value to RetentionDays.INFINITE.
Default: RetentionDays.TWO_YEARS
- Parameters:
retention
- How long, in days, the log contents will be retained. This parameter is required.- Returns:
this
-
build
-