Interface ExecuteCommandLogConfiguration

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
ExecuteCommandLogConfiguration.Jsii$Proxy

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:47.313Z") @Stability(Stable) public interface ExecuteCommandLogConfiguration extends software.amazon.jsii.JsiiSerializable
The log configuration for the results of the execute command actions.

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();
 
  • Method Details

    • getCloudWatchEncryptionEnabled

      @Stability(Stable) @Nullable default Boolean getCloudWatchEncryptionEnabled()
      Whether or not to enable encryption on the CloudWatch logs.

      Default: - encryption will be disabled.

    • getCloudWatchLogGroup

      @Stability(Stable) @Nullable default ILogGroup getCloudWatchLogGroup()
      The name of the CloudWatch log group to send logs to.

      The CloudWatch log group must already be created.

      Default: - none

    • getS3Bucket

      @Stability(Stable) @Nullable default IBucket getS3Bucket()
      The name of the S3 bucket to send logs to.

      The S3 bucket must already be created.

      Default: - none

    • getS3EncryptionEnabled

      @Stability(Stable) @Nullable default Boolean getS3EncryptionEnabled()
      Whether or not to enable encryption on the CloudWatch logs.

      Default: - encryption will be disabled.

    • getS3KeyPrefix

      @Stability(Stable) @Nullable default String getS3KeyPrefix()
      An optional folder in the S3 bucket to place logs in.

      Default: - none

    • builder

      @Stability(Stable) static ExecuteCommandLogConfiguration.Builder builder()
      Returns:
      a ExecuteCommandLogConfiguration.Builder of ExecuteCommandLogConfiguration