Recipe
task-ecs
The generic ephemeral compute primitive as an Amazon ECS task on Fargate that an EventBridge Scheduler schedule starts, rendered by vendoring a Terraform module kept beside this Recipe. 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, the task definition and the 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:0977a38b24b3bda44706b32634b2b124401b6766332d23ab9612fb0c2a0aa4dd
- 게시일
- 2026-11-10T10:28:58Z
- 서명 ID
- 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:0a65ecbad72c393b48c3a29a9602d45100464212323c48f3f4e37d716a35f17b
이 버전의 참조
oci://hub.aggrega.ai/recipe/terraform/task-ecs:1.0.0- 대상
- —
- 구현 대상
- core/compute/task:1.0.0
제공
이 레시피가 소비자를 위해 배선하는 결정적 포인터 템플릿입니다.
선언된 provides 템플릿이 없습니다.
Workload
선언된 워크로드 템플릿이 없습니다.
로컬 변수
| 이름 | 템플릿 |
|---|---|
| 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
사용됨
카탈로그에서 이 엔터티에 의존하는 것이 없습니다.