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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configured instance.encryptionKey(IKey encryptionKey) Sets the value ofLogGroupProps.getEncryptionKey()logGroupName(String logGroupName) Sets the value ofLogGroupProps.getLogGroupName()removalPolicy(RemovalPolicy removalPolicy) Sets the value ofLogGroupProps.getRemovalPolicy()retention(RetentionDays retention) Sets the value ofLogGroupProps.getRetention()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
encryptionKey
Sets the value ofLogGroupProps.getEncryptionKey()- Parameters:
encryptionKey- The KMS Key to encrypt the log group with.- Returns:
this
-
logGroupName
Sets the value ofLogGroupProps.getLogGroupName()- Parameters:
logGroupName- Name of the log group.- Returns:
this
-
removalPolicy
Sets the value ofLogGroupProps.getRemovalPolicy()- 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
Sets the value ofLogGroupProps.getRetention()- 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
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<LogGroupProps>- Returns:
- a new instance of
LogGroupProps - Throws:
NullPointerException- if any required attribute was not provided
-