Class EcsTask
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.events.targets.EcsTask
- All Implemented Interfaces:
- IRuleTarget,- software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
           date="2023-06-19T16:30:47.726Z")
@Stability(Stable)
public class EcsTask
extends software.amazon.jsii.JsiiObject
implements IRuleTarget
Start a task on an ECS cluster.
 
Example:
 import software.amazon.awscdk.services.events.Rule;
 import software.amazon.awscdk.services.events.Schedule;
 import software.amazon.awscdk.services.events.targets.EcsTask;
 import software.amazon.awscdk.services.ecs.Cluster;
 import software.amazon.awscdk.services.ecs.TaskDefinition;
 import software.amazon.awscdk.services.iam.Role;
 Cluster cluster;
 TaskDefinition taskDefinition;
 Role role;
 EcsTask ecsTaskTarget = EcsTask.Builder.create().cluster(cluster).taskDefinition(taskDefinition).role(role).build();
 Rule.Builder.create(this, "ScheduleRule")
         .schedule(Schedule.cron(CronOptions.builder().minute("0").hour("4").build()))
         .targets(List.of(ecsTaskTarget))
         .build();
 - 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObjectsoftware.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.events.IRuleTargetIRuleTarget.Jsii$Default, IRuleTarget.Jsii$Proxy
- 
Constructor SummaryConstructorsModifierConstructorDescriptionEcsTask(EcsTaskProps props) protectedEcsTask(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedEcsTask(software.amazon.jsii.JsiiObjectRef objRef) 
- 
Method SummaryModifier and TypeMethodDescriptionAllows using tasks as target of EventBridge events.Allows using tasks as target of EventBridge events.Deprecated.use securityGroups instead.The security groups associated with the task.Methods inherited from class software.amazon.jsii.JsiiObjectjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable$jsii$toJson
- 
Constructor Details- 
EcsTaskprotected EcsTask(software.amazon.jsii.JsiiObjectRef objRef) 
- 
EcsTaskprotected EcsTask(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) 
- 
EcsTask- Parameters:
- props- This parameter is required.
 
 
- 
- 
Method Details- 
bind@Stability(Stable) @NotNull public RuleTargetConfig bind(@NotNull IRule _rule, @Nullable String _id) Allows using tasks as target of EventBridge events.- Specified by:
- bindin interface- IRuleTarget
- Parameters:
- _rule- This parameter is required.
- _id-
 
- 
bindAllows using tasks as target of EventBridge events.- Specified by:
- bindin interface- IRuleTarget
- Parameters:
- _rule- This parameter is required.
 
- 
getSecurityGroupDeprecated.use securityGroups instead.(deprecated) The security group associated with the task.Only applicable with awsvpc network mode. Default: - A new security group is created. 
- 
getSecurityGroupsThe security groups associated with the task.Only applicable with awsvpc network mode. Default: - A new security group is created. 
 
-