Class ExecuteCommandLogging
The log settings to use to for logging the execute command session.
Inheritance
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public sealed class ExecuteCommandLogging : Enum
Syntax (vb)
Public NotInheritable Class ExecuteCommandLogging
Inherits
Enum
Remarks
For more information, see [Logging] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandconfiguration.html#cfn-ecs-cluster-executecommandconfiguration-logging
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
Fields
DEFAULT | The awslogs configuration in the task definition is used. |
NONE | The execute command session is not logged. |
OVERRIDE | Specify the logging details as a part of logConfiguration. |
value__ |
Fields
DEFAULT
The awslogs configuration in the task definition is used.
public const ExecuteCommandLogging DEFAULT
Field Value
Type | Description |
---|---|
ExecuteCommandLogging |
Remarks
If no logging parameter is specified, it defaults to this value. If no awslogs log driver is configured in the task definition, the output won't be logged.
NONE
The execute command session is not logged.
public const ExecuteCommandLogging NONE
Field Value
Type | Description |
---|---|
ExecuteCommandLogging |
OVERRIDE
Specify the logging details as a part of logConfiguration.
public const ExecuteCommandLogging OVERRIDE
Field Value
Type | Description |
---|---|
ExecuteCommandLogging |
value__
public int value__
Field Value
Type | Description |
---|---|
System.Int32 |