Interface IExecuteCommandLogConfiguration
The log configuration for the results of the execute command actions.
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.AWS.ECS.dll
Syntax (csharp)
public interface IExecuteCommandLogConfiguration
Syntax (vb)
Public Interface IExecuteCommandLogConfiguration
Remarks
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
ExampleMetadata: infused
Examples
Vpc vpc;
var kmsKey = new Key(this, "KmsKey");
// Pass the KMS key in the `encryptionKey` field to associate the key to the log group
var logGroup = new LogGroup(this, "LogGroup", new LogGroupProps {
EncryptionKey = kmsKey
});
// Pass the KMS key in the `encryptionKey` field to associate the key to the S3 bucket
var execBucket = new Bucket(this, "EcsExecBucket", new BucketProps {
EncryptionKey = kmsKey
});
var cluster = new Cluster(this, "Cluster", new ClusterProps {
Vpc = vpc,
ExecuteCommandConfiguration = new ExecuteCommandConfiguration {
KmsKey = kmsKey,
LogConfiguration = new ExecuteCommandLogConfiguration {
CloudWatchLogGroup = logGroup,
CloudWatchEncryptionEnabled = true,
S3Bucket = execBucket,
S3EncryptionEnabled = true,
S3KeyPrefix = "exec-command-output"
},
Logging = ExecuteCommandLogging.OVERRIDE
}
});
Synopsis
Properties
CloudWatchEncryptionEnabled | Whether or not to enable encryption on the CloudWatch logs. |
CloudWatchLogGroup | The name of the CloudWatch log group to send logs to. |
S3Bucket | The name of the S3 bucket to send logs to. |
S3EncryptionEnabled | Whether or not to enable encryption on the CloudWatch logs. |
S3KeyPrefix | An optional folder in the S3 bucket to place logs in. |
Properties
CloudWatchEncryptionEnabled
Whether or not to enable encryption on the CloudWatch logs.
virtual Nullable<bool> CloudWatchEncryptionEnabled { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - encryption will be disabled.
CloudWatchLogGroup
The name of the CloudWatch log group to send logs to.
virtual ILogGroup CloudWatchLogGroup { get; }
Property Value
Remarks
The CloudWatch log group must already be created.
Default: - none
S3Bucket
The name of the S3 bucket to send logs to.
virtual IBucket S3Bucket { get; }
Property Value
Remarks
The S3 bucket must already be created.
Default: - none
S3EncryptionEnabled
Whether or not to enable encryption on the CloudWatch logs.
virtual Nullable<bool> S3EncryptionEnabled { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - encryption will be disabled.
S3KeyPrefix
An optional folder in the S3 bucket to place logs in.
virtual string S3KeyPrefix { get; }
Property Value
System.String
Remarks
Default: - none