Class ScheduledEc2Task
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.services.ecs.patterns.ScheduledTaskBase
software.amazon.awscdk.services.ecs.patterns.ScheduledEc2Task
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-27T16:50:57.214Z")
@Stability(Stable)
public class ScheduledEc2Task
extends ScheduledTaskBase
A scheduled EC2 task that will be initiated off of CloudWatch Events.
Example:
// Instantiate an Amazon EC2 Task to run at a scheduled interval Cluster cluster; ScheduledEc2Task ecsScheduledTask = ScheduledEc2Task.Builder.create(this, "ScheduledTask") .cluster(cluster) .scheduledEc2TaskImageOptions(ScheduledEc2TaskImageOptions.builder() .image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample")) .memoryLimitMiB(256) .environment(Map.of("name", "TRIGGER", "value", "CloudWatch Events")) .build()) .schedule(Schedule.expression("rate(1 minute)")) .enabled(true) .ruleName("sample-scheduled-task-rule") .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
ScheduledEc2Task
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
ScheduledEc2Task
(software.amazon.jsii.JsiiObjectRef objRef) ScheduledEc2Task
(software.constructs.Construct scope, String id, ScheduledEc2TaskProps props) Constructs a new instance of the ScheduledEc2Task class. -
Method Summary
Modifier and TypeMethodDescriptiongetTask()
The ECS task in this construct.The EC2 task definition in this construct.Methods inherited from class software.amazon.awscdk.services.ecs.patterns.ScheduledTaskBase
addTaskAsTarget, addTaskDefinitionToEventTarget, createAWSLogDriver, getCluster, getDefaultCluster, getDefaultCluster, getDesiredTaskCount, getEventRule, getPropagateTags, getSubnetSelection, getTags
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
ScheduledEc2Task
protected ScheduledEc2Task(software.amazon.jsii.JsiiObjectRef objRef) -
ScheduledEc2Task
protected ScheduledEc2Task(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
ScheduledEc2Task
@Stability(Stable) public ScheduledEc2Task(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ScheduledEc2TaskProps props) Constructs a new instance of the ScheduledEc2Task class.- Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
getTask
The ECS task in this construct. -
getTaskDefinition
The EC2 task definition in this construct.
-