Enum AwsLogDriverMode
- All Implemented Interfaces:
Serializable
,Comparable<AwsLogDriverMode>
,java.lang.constant.Constable
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:47.011Z")
@Stability(Stable)
public enum AwsLogDriverMode
extends Enum<AwsLogDriverMode>
awslogs provides two modes for delivering messages from the container to the log driver.
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());
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription(default) direct, blocking delivery from container to driver.The non-blocking message delivery mode prevents applications from blocking due to logging back pressure. -
Method Summary
Modifier and TypeMethodDescriptionstatic AwsLogDriverMode
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.
-
Enum Constant Details
-
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.Applications are likely to fail in unexpected ways when STDERR or STDOUT streams block.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-