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.118.0 (build 02eec31)",
date="2025-11-04T09:27:41.139Z")
@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 ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedScheduledEc2Task(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedScheduledEc2Task(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, getTagsMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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.
-