ExecuteCommandLogConfiguration Struct
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
ts
declare const vpc: ec2.Vpc;
const kmsKey = new kms.Key(this, 'KmsKey');
// Pass the KMS key in the `encryptionKey` field to associate the key to the log group
const logGroup = new logs.LogGroup(this, 'LogGroup', {
encryptionKey: kmsKey,
});
// Pass the KMS key in the `encryptionKey` field to associate the key to the S3 bucket
const execBucket = new s3.Bucket(this, 'EcsExecBucket', {
encryptionKey: kmsKey,
});
const cluster = new ecs.Cluster(this, 'Cluster', {
vpc,
executeCommandConfiguration: {
kmsKey,
logConfiguration: {
cloudWatchLogGroup: logGroup,
cloudWatchEncryptionEnabled: true,
s3Bucket: execBucket,
s3EncryptionEnabled: true,
s3KeyPrefix: 'exec-command-output',
},
logging: ecs.ExecuteCommandLogging.OVERRIDE,
},
});
Properties
cloudWatchEncryptionEnabledoptionalbooleancloud_watch_encryption_enabledoptionalboolcloudWatchEncryptionEnabledoptionalBooleanCloudWatchEncryptionEnabledoptionalboolCloudWatchEncryptionEnabledoptional*bool#Whether or not to enable encryption on the CloudWatch logs.
Default: encryption will be disabled.
cloudWatchLogGroupoptionalILogGroupRefcloud_watch_log_groupoptionalILogGroupRefcloudWatchLogGroupoptionalILogGroupRefCloudWatchLogGroupoptionalILogGroupRefCloudWatchLogGroupoptionalILogGroupRef= none#The name of the CloudWatch log group to send logs to.
The CloudWatch log group must already be created.
s3BucketoptionalIBuckets3_bucketoptionalIBuckets3BucketoptionalIBucketS3BucketoptionalIBucketS3BucketoptionalIBucket= none#The name of the S3 bucket to send logs to.
The S3 bucket must already be created.
s3EncryptionEnabledoptionalbooleans3_encryption_enabledoptionalbools3EncryptionEnabledoptionalBooleanS3EncryptionEnabledoptionalboolS3EncryptionEnabledoptional*bool#Whether or not to enable encryption on the S3 bucket.
Default: encryption will be disabled.
s3KeyPrefixoptionalstrings3_key_prefixoptionalstrs3KeyPrefixoptionalStringS3KeyPrefixoptionalstringS3KeyPrefixoptional*string= none#An optional folder in the S3 bucket to place logs in.