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.dataProtectionPolicy(DataProtectionPolicy dataProtectionPolicy) Sets the value ofLogGroupProps.getDataProtectionPolicy()encryptionKey(IKeyRef encryptionKey) Sets the value ofLogGroupProps.getEncryptionKey()fieldIndexPolicies(List<? extends FieldIndexPolicy> fieldIndexPolicies) Sets the value ofLogGroupProps.getFieldIndexPolicies()logGroupClass(LogGroupClass logGroupClass) Sets the value ofLogGroupProps.getLogGroupClass()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
-
dataProtectionPolicy
@Stability(Stable) public LogGroupProps.Builder dataProtectionPolicy(DataProtectionPolicy dataProtectionPolicy) Sets the value ofLogGroupProps.getDataProtectionPolicy()- Parameters:
dataProtectionPolicy- Data Protection Policy for this log group.- Returns:
this
-
encryptionKey
Sets the value ofLogGroupProps.getEncryptionKey()- 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) Sets the value ofLogGroupProps.getFieldIndexPolicies()- Parameters:
fieldIndexPolicies- Field Index Policies for this log group.- Returns:
this
-
logGroupClass
Sets the value ofLogGroupProps.getLogGroupClass()- 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
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
-