Class AwsLogDriverMode
awslogs provides two modes for delivering messages from the container to the log driver.
Inheritance
System.Object
AwsLogDriverMode
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.AWS.ECS.dll
Syntax (csharp)
public sealed class AwsLogDriverMode : Enum
Syntax (vb)
Public NotInheritable Class AwsLogDriverMode
Inherits
Enum
Remarks
ExampleMetadata: infused
Examples
Cluster cluster;
// Create a Task Definition for the container to start
var taskDefinition = new Ec2TaskDefinition(this, "TaskDef");
taskDefinition.AddContainer("TheContainer", new ContainerDefinitionOptions {
Image = ContainerImage.FromAsset(Resolve(__dirname, "..", "eventhandler-image")),
MemoryLimitMiB = 256,
Logging = new AwsLogDriver(new AwsLogDriverProps { StreamPrefix = "EventDemo", Mode = AwsLogDriverMode.NON_BLOCKING })
});
// An Rule that describes the event trigger (in this case a scheduled run)
var rule = new Rule(this, "Rule", new RuleProps {
Schedule = Schedule.Expression("rate(1 min)")
});
// Pass an environment variable to the container 'TheContainer' in the task
rule.AddTarget(new EcsTask(new EcsTaskProps {
Cluster = cluster,
TaskDefinition = taskDefinition,
TaskCount = 1,
ContainerOverrides = new [] { new ContainerOverride {
ContainerName = "TheContainer",
Environment = new [] { new TaskEnvironmentVariable {
Name = "I_WAS_TRIGGERED",
Value = "From CloudWatch Events"
} }
} }
}));
Synopsis
Fields
BLOCKING | (default) direct, blocking delivery from container to driver. |
NON_BLOCKING | The non-blocking message delivery mode prevents applications from blocking due to logging back pressure. |
value__ |
Fields
BLOCKING
(default) direct, blocking delivery from container to driver.
public const AwsLogDriverMode BLOCKING
Field Value
Type | Description |
---|---|
AwsLogDriverMode |
NON_BLOCKING
The non-blocking message delivery mode prevents applications from blocking due to logging back pressure.
public const AwsLogDriverMode NON_BLOCKING
Field Value
Type | Description |
---|---|
AwsLogDriverMode |
Remarks
Applications are likely to fail in unexpected ways when STDERR or STDOUT streams block.
value__
public int value__
Field Value
Type | Description |
---|---|
System.Int32 |