@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.698Z") @Stability(value=Stable) public interface ExecuteCommandLogConfiguration extends software.amazon.jsii.JsiiSerializable
The logs can be sent to CloudWatch Logs and/ or an Amazon S3 bucket. For more information, see [ExecuteCommandLogConfiguration] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandlogconfiguration.html
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 |
ExecuteCommandLogConfiguration.Builder
A builder for
ExecuteCommandLogConfiguration |
static class |
ExecuteCommandLogConfiguration.Jsii$Proxy
An implementation for
ExecuteCommandLogConfiguration |
| Modifier and Type | Method and Description |
|---|---|
static ExecuteCommandLogConfiguration.Builder |
builder() |
default Boolean |
getCloudWatchEncryptionEnabled()
Whether or not to enable encryption on the CloudWatch logs.
|
default ILogGroup |
getCloudWatchLogGroup()
The name of the CloudWatch log group to send logs to.
|
default IBucket |
getS3Bucket()
The name of the S3 bucket to send logs to.
|
default Boolean |
getS3EncryptionEnabled()
Whether or not to enable encryption on the CloudWatch logs.
|
default String |
getS3KeyPrefix()
An optional folder in the S3 bucket to place logs in.
|
@Stability(value=Stable) @Nullable default Boolean getCloudWatchEncryptionEnabled()
Default: - encryption will be disabled.
@Stability(value=Stable) @Nullable default ILogGroup getCloudWatchLogGroup()
The CloudWatch log group must already be created.
Default: - none
@Stability(value=Stable) @Nullable default IBucket getS3Bucket()
The S3 bucket must already be created.
Default: - none
@Stability(value=Stable) @Nullable default Boolean getS3EncryptionEnabled()
Default: - encryption will be disabled.
@Stability(value=Stable) @Nullable default String getS3KeyPrefix()
Default: - none
@Stability(value=Stable) static ExecuteCommandLogConfiguration.Builder builder()
Copyright © 2022. All rights reserved.