@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:40.708Z") @Stability(value=Stable) public interface LogGroupProps extends software.amazon.jsii.JsiiSerializable
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();
| Modifier and Type | Interface and Description |
|---|---|
static class |
LogGroupProps.Builder
A builder for
LogGroupProps |
static class |
LogGroupProps.Jsii$Proxy
An implementation for
LogGroupProps |
| Modifier and Type | Method and Description |
|---|---|
static LogGroupProps.Builder |
builder() |
default IKey |
getEncryptionKey()
The KMS customer managed key to encrypt the log group with.
|
default String |
getLogGroupName()
Name of the log group.
|
default RemovalPolicy |
getRemovalPolicy()
Determine the removal policy of this log group.
|
default RetentionDays |
getRetention()
How long, in days, the log contents will be retained.
|
@Stability(value=Stable) @Nullable default IKey getEncryptionKey()
Default: Server-side encrpytion managed by the CloudWatch Logs service
@Stability(value=Stable) @Nullable default String getLogGroupName()
Default: Automatically generated
@Stability(value=Stable) @Nullable default RemovalPolicy getRemovalPolicy()
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
@Stability(value=Stable) @Nullable default RetentionDays getRetention()
To retain all logs, set this value to RetentionDays.INFINITE.
Default: RetentionDays.TWO_YEARS
@Stability(value=Stable) static LogGroupProps.Builder builder()
LogGroupProps.Builder of LogGroupPropsCopyright © 2022. All rights reserved.