@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.574Z") @Stability(value=Stable) public enum AwsLogDriverMode extends Enum<AwsLogDriverMode>
Example:
Cluster cluster;
// Create a Task Definition for the container to start
Ec2TaskDefinition taskDefinition = new Ec2TaskDefinition(this, "TaskDef");
taskDefinition.addContainer("TheContainer", ContainerDefinitionOptions.builder()
.image(ContainerImage.fromAsset(resolve(__dirname, "..", "eventhandler-image")))
.memoryLimitMiB(256)
.logging(AwsLogDriver.Builder.create().streamPrefix("EventDemo").mode(AwsLogDriverMode.NON_BLOCKING).build())
.build());
// An Rule that describes the event trigger (in this case a scheduled run)
Rule rule = Rule.Builder.create(this, "Rule")
.schedule(Schedule.expression("rate(1 min)"))
.build();
// Pass an environment variable to the container 'TheContainer' in the task
rule.addTarget(EcsTask.Builder.create()
.cluster(cluster)
.taskDefinition(taskDefinition)
.taskCount(1)
.containerOverrides(List.of(ContainerOverride.builder()
.containerName("TheContainer")
.environment(List.of(TaskEnvironmentVariable.builder()
.name("I_WAS_TRIGGERED")
.value("From CloudWatch Events")
.build()))
.build()))
.build());
| Enum Constant and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
static AwsLogDriverMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static AwsLogDriverMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
@Stability(value=Stable) public static final AwsLogDriverMode BLOCKING
@Stability(value=Stable) public static final AwsLogDriverMode NON_BLOCKING
Applications are likely to fail in unexpected ways when STDERR or STDOUT streams block.
public static AwsLogDriverMode[] values()
for (AwsLogDriverMode c : AwsLogDriverMode.values()) System.out.println(c);
public static AwsLogDriverMode valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2022. All rights reserved.