FargateTaskProps Struct
Properties for scheduling an ECS Fargate Task.
Example
import * as ecs from 'aws-cdk-lib/aws-ecs';
declare const cluster: ecs.ICluster;
declare const taskDefinition: ecs.FargateTaskDefinition;
new Schedule(this, 'Schedule', {
schedule: ScheduleExpression.rate(cdk.Duration.minutes(60)),
target: new targets.EcsRunFargateTask(cluster, {
taskDefinition,
}),
});
Properties
assignPublicIpbooleanassign_public_ipboolassignPublicIpBooleanAssignPublicIpboolAssignPublicIp*bool= true if the subnet type is PUBLI…#If true, the task will receive a public IP address and be accessible from the internet. Should only be set to true when using public subnets.
default
Default: true if the subnet type is PUBLIC, otherwise false
capacityProviderStrategiesCapacityProviderStrategy[]capacity_provider_strategiestyping.List[CapacityProviderStrategy]capacityProviderStrategiesList<CapacityProviderStrategy>CapacityProviderStrategiesCapacityProviderStrategy[]CapacityProviderStrategies*[]CapacityProviderStrategy= No capacity provider strategy#deadLetterQueueIQueuedead_letter_queueIQueuedeadLetterQueueIQueueDeadLetterQueueIQueueDeadLetterQueueIQueue= no dead-letter queue#notes
The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.
enableEcsManagedTagsbooleanenable_ecs_managed_tagsboolenableEcsManagedTagsBooleanEnableEcsManagedTagsboolEnableEcsManagedTags*bool= false#enableExecuteCommandbooleanenable_execute_commandboolenableExecuteCommandBooleanEnableExecuteCommandboolEnableExecuteCommand*bool= false#If true, this enables execute command functionality on all containers in the task.
inputScheduleTargetInputinputScheduleTargetInputinputScheduleTargetInputInputScheduleTargetInputInputScheduleTargetInput= no input.#maxEventAgeDurationmax_event_ageDurationmaxEventAgeDurationMaxEventAgeDurationMaxEventAgeDuration= Duration.hours(24)#Minimum value of 60. Maximum value of 86400.
platformVersionFargatePlatformVersionplatform_versionFargatePlatformVersionplatformVersionFargatePlatformVersionPlatformVersionFargatePlatformVersionPlatformVersionFargatePlatformVersion= LATEST#Specify only the numeric portion of the platform version, such as 1.1.0. Platform versions determine the underlying runtime environment for the task.
propagateTagsbooleanpropagate_tagsboolpropagateTagsBooleanPropagateTagsboolPropagateTags*bool= No tag propagation#If no value is specified, the tags are not propagated.
referenceIdstringreference_idstrreferenceIdStringReferenceIdstringReferenceId*string= No reference ID.#retryAttemptsnumberretry_attemptsint | floatretryAttemptsNumberRetryAttemptsdoubleRetryAttempts*float64= 185#Minimum value of 0. Maximum value of 185.
notes
If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions.
securityGroupsISecurityGroup[]security_groupstyping.List[ISecurityGroup]securityGroupsList<ISecurityGroup>SecurityGroupsISecurityGroup[]SecurityGroups*[]ISecurityGroup= The security group for the VPC i…#These security groups must all be in the same VPC. Controls inbound and outbound network access for the task.
default
Default: The security group for the VPC is used.
Each tag consists of a key and an optional value, both of which you define.
taskDefinitionTaskDefinitiontask_definitionTaskDefinitiontaskDefinitionTaskDefinitionTaskDefinitionTaskDefinitionTaskDefinitionTaskDefinitionrequired#Note: this must be TaskDefinition, and not ITaskDefinition, as it requires properties that are not known for imported task definitions If you want to run a RunTask with an imported task definition, consider using a Universal target.
vpcSubnetsSubnetSelectionvpc_subnetsSubnetSelectionvpcSubnetsSubnetSelectionVpcSubnetsSubnetSelectionVpcSubnetsSubnetSelection= all private subnets of the VPC a…#These subnets must all be in the same VPC. The task will be launched in these subnets.
default
Default: all private subnets of the VPC are selected.