Recipe
task-ecs
The generic ephemeral compute primitive as an Amazon ECS task on Fargate that an EventBridge Scheduler schedule starts, rendered as a CloudFormation fragment the provider assembles into the boundary's stack. Reach for it where the target is an AWS account with an ECS cluster and a VPC; reach for helm/task on Kubernetes, which also runs a task with no schedule once. A task with no schedule carrying core/manual-trigger is deployed without starting, its task definition alone; the operator starts each run with aws ecs run-task, giving the cluster, task definition and network configuration from infra.overrides. A scheduled task runs on its schedule, attached or not, and can be started that way too. Any other unscheduled task is refused by name, as nothing on AWS starts it. The cron fields become the scheduler's own expression where the two mean the same times, evaluated in UTC unless the Release names a time zone, and are refused by name where they do not, as for a schedule restricting both the day of the month and the day of the week. The cluster, subnets, security groups, execution role and, with a schedule, the scheduler's role come from infra.overrides and are required. Only a task definition and a schedule are emitted: no role, log group or network resource, each of which the operator already runs, and no service, as a run ends. Each env entry an edge or the component's own inject block dictates becomes a container variable; timeout arrives by default as TASK_TIMEOUT, which no edge may dictate while it is the default, for the code to honour, as ECS sets no deadline on a run. File, arg and other entries are refused by name. The task runs at the smallest Fargate size meeting infra.compute.
版本
来源
- 内容摘要
- sha256:aa6a30be8eac6fcdb2c9b2d182eae712509715049ce5370a4e1c55cce3b64866
- 发布时间
- 2026-11-10T10:18:01Z
- 签名身份
- https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main
签名
- 官方application/vnd.dev.sigstore.bundle.v0.3+json
https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main
sha256:e3a34156c0f43aaaede77f5e9d3882ab6ec500e829c0e5fca0b51d1f5fe77d8d
此版本的引用
oci://hub.aggrega.ai/recipe/cloudformation/task-ecs:1.0.0- 目标
- —
- 实现
- core/compute/task:1.0.0
提供
此配方为使用方接入的确定性指针模板。
未声明 provides 模板。
Workload
未声明工作负载模板。
局部变量
| 名称 | 模板 |
|---|---|
| logical_id | {{ capitalizedWords .context.instance_id }} |
| instance_id | {{ .context.instance_id }} |
| schedule_translation | {{- $s := trim (toString (optional .values "schedule" "")) -}} {{- $out := "" -}} {{- if $s -}} {{- $f := regexSplit `\s+` $s -1 -}} {{- $descriptors := dict "@yearly" "0 0 1 1 *" "@annually" "0 0 1 1 *" "@monthly" "0 0 1 * *" "@weekly" "0 0 * * 0" "@daily" "0 0 * * *" "@midnight" "0 0 * * *" "@hourly" "0 * * * *" -}} {{- if and (eq (len $f) 1) (hasKey $descriptors (index $f 0)) -}} {{- $f = regexSplit `\s+` (index $descriptors (index $f 0)) -1 -}} {{- end -}} {{- if hasPrefix "@every" $s -}} {{- $out = "refuse:@every repeats at an interval counted from a moment Kubernetes chooses, which an EventBridge Scheduler schedule cannot reproduce: write the schedule as five cron fields" -}} {{- else if regexMatch `^(CRON_)?TZ=` (index $f 0) -}} {{- $out = "refuse:it names a time zone inside the expression, where an EventBridge Scheduler expression takes none: write the five fields alone, and name the time zone under infra.overrides in the Release" -}} {{- else if ne (len $f) 5 -}} {{- $out = printf "refuse:it has %d fields where a cron expression has five, minute, hour, day of the month, month and day of the week: write the schedule as those five fields" (len $f) -}} {{- else -}} {{- $item := `^(\*|\?|[0-9]+(-[0-9]+)?)(/[0-9]+)?
|
| cpu_millicores | {{- $c := toString (optional (optional .infra "compute" dict) "cpu" "") -}} {{- if regexMatch `^[0-9]+m
|
| memory_mib | {{- $m := toString (optional (optional .infra "compute" dict) "memory" "") -}} {{- if regexMatch `^[0-9]+Mi
|
| task_size | {{- $found := "" -}} {{- if and .locals.cpu_millicores .locals.memory_mib -}} {{- $mc := atoi .locals.cpu_millicores -}}{{- $mib := atoi .locals.memory_mib -}} {{- range list (list 256 (list 512 1024 2048)) (list 512 (untilStep 1024 4097 1024)) (list 1024 (untilStep 2048 8193 1024)) (list 2048 (untilStep 4096 16385 1024)) (list 4096 (untilStep 8192 30721 1024)) (list 8192 (untilStep 16384 61441 4096)) (list 16384 (untilStep 32768 122881 8192)) (list 32768 (list 61440 122880 249856)) -}} {{- $cpu := index . 0 -}} {{- if and (not $found) (ge (mul $cpu 1000) (mul $mc 1024)) -}} {{- range index . 1 }}{{ if and (not $found) (ge . $mib) }}{{ $found = printf "%d/%d" $cpu . }}{{ end }}{{ end -}} {{- end -}} {{- end -}} {{- end -}} {{- $found -}} |
| task_cpu | {{ if .locals.task_size }}{{ index (splitList "/" .locals.task_size) 0 }}{{ end }} |
| task_memory | {{ if .locals.task_size }}{{ index (splitList "/" .locals.task_size) 1 }}{{ end }} |
值映射
未声明值映射。
关系
与其他已发布实体之间的类型化边。没有已发布目标的引用会呈现为断开的边,而不是链接。
使用
- 实现实现
core/compute/task:1.0.0
被使用
目录中没有任何内容依赖此实体。