Interface LogGroupProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
LogGroupProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:38.104Z")
@Stability(Stable)
public interface LogGroupProps
extends software.amazon.jsii.JsiiSerializable
Properties for a LogGroup.
Example:
Vpc vpc;
Key kmsKey = new Key(this, "KmsKey");
// Pass the KMS key in the `encryptionKey` field to associate the key to the log group
LogGroup logGroup = LogGroup.Builder.create(this, "LogGroup")
.encryptionKey(kmsKey)
.build();
// Pass the KMS key in the `encryptionKey` field to associate the key to the S3 bucket
Bucket execBucket = Bucket.Builder.create(this, "EcsExecBucket")
.encryptionKey(kmsKey)
.build();
Cluster cluster = Cluster.Builder.create(this, "Cluster")
.vpc(vpc)
.executeCommandConfiguration(ExecuteCommandConfiguration.builder()
.kmsKey(kmsKey)
.logConfiguration(ExecuteCommandLogConfiguration.builder()
.cloudWatchLogGroup(logGroup)
.cloudWatchEncryptionEnabled(true)
.s3Bucket(execBucket)
.s3EncryptionEnabled(true)
.s3KeyPrefix("exec-command-output")
.build())
.logging(ExecuteCommandLogging.OVERRIDE)
.build())
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forLogGroupPropsstatic final classAn implementation forLogGroupProps -
Method Summary
Modifier and TypeMethodDescriptionstatic LogGroupProps.Builderbuilder()default IKeyThe KMS Key to encrypt the log group with.default StringName of the log group.default RemovalPolicyDetermine the removal policy of this log group.default RetentionDaysHow long, in days, the log contents will be retained.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getEncryptionKey
The KMS Key to encrypt the log group with.Default: - log group is encrypted with the default master key
-
getLogGroupName
Name of the log group.Default: Automatically generated
-
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
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
- Returns:
- a
LogGroupProps.BuilderofLogGroupProps
-