Currently, we are managing our database schemas in a DDL repository and attempting to automate migration execution by running a standalone ECS Task (not attached to any Service). The general workflow is as follows, and each step works as expected when tested individually:
- Compress the checked-out repository.
- Install necessary tools: mise, yq, ecspresso, ecsta, awscliv2, session-manager-plugin.
- Authenticate with AWS using OIDC.
- Start an ECS Task using ecspresso run.
- Use ecsta to send the compressed repository and a .env file (referenced during migration) into the ECS Task.
- Execute the migration inside the Task using ecsta exec:
- Run bun install
- Run bun run migration:run
However, when automating this workflow with GitHub Actions, we encountered an error at step 5:
[ERROR] [error:failed to execute command. operation error ECS: ExecuteCommand,
https response error StatusCode: 400, RequestID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX,
InvalidParameterException: The execute command failed because execute command was not enabled
when the task was run or the execute command agent isn’t running.
Wait and try again or run a new task with execute command enabled and try again.
See also https://github.com/aws-containers/amazon-ecs-exec-checker] failed to boot agent
When I asked an AI (Perplexity) what this means, I was told that ECS Exec is not enabled for the task,
so I should run the task with the --enable-execute-command option using the AWS CLI.
Therefore, I would like to request the addition of a --enable-execute-command option to the ecspresso run command.
(in Japanese)
ecspresso run に --enable-execute-command オプションが欲しい
DBスキーマを ddl リポジトリで管理している状況下で、
マイグレーション実行の自動化を Service に紐づかない ECS Task の単体で実現しようとしています。
大雑把な流れとして以下を組んでいて、それぞれ単体では期待動作を確認できています。
- checkout したリポジトリを圧縮しておく
- 各種インストール(mise、yq、ecspresso、ecsta、awscliv2、session-manager-plugin)
- AWSに認証を通す(OIDC)
- ecspresso run で ECS Task 起動
- ecsta を利用して 1.で圧縮したリポジトリとマイグレーション実行時に参照する .env を作って ECS Task に送り込む
- ecsta exec でマイグレーション実行(bun install -> bun run migration:run)
これを GitHub Actions で自動化した際に、5 で以下エラーとなって躓いています。
↑と同じ内容なので括る。こちらには細工したスクリーンショットも入れておきます
[ERROR] [error:failed to execute command. operation error ECS: ExecuteCommand,
https response error StatusCode: 400, RequestID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX,
InvalidParameterException: The execute command failed because execute command was not enabled
when the task was run or the execute command agent isn’t running.
Wait and try again or run a new task with execute command enabled and try again.
See also https://github.com/aws-containers/amazon-ecs-exec-checker] failed to boot agent

AI (Perplexity) に↑どういうこと?と尋ねたところ、ECS Exec できる状態にないから
aws cli で --enable-execute-command オプションをつけてタスク起動しろとのこと。
というわけで、これが欲しくなった次第。
Currently, we are managing our database schemas in a DDL repository and attempting to automate migration execution by running a standalone ECS Task (not attached to any Service). The general workflow is as follows, and each step works as expected when tested individually:
However, when automating this workflow with GitHub Actions, we encountered an error at step 5:
When I asked an AI (Perplexity) what this means, I was told that ECS Exec is not enabled for the task,
so I should run the task with the --enable-execute-command option using the AWS CLI.
Therefore, I would like to request the addition of a --enable-execute-command option to the ecspresso run command.
(in Japanese)
ecspresso run に --enable-execute-command オプションが欲しい
DBスキーマを ddl リポジトリで管理している状況下で、
マイグレーション実行の自動化を Service に紐づかない ECS Task の単体で実現しようとしています。
大雑把な流れとして以下を組んでいて、それぞれ単体では期待動作を確認できています。
これを GitHub Actions で自動化した際に、5 で以下エラーとなって躓いています。
↑と同じ内容なので括る。こちらには細工したスクリーンショットも入れておきます
AI (Perplexity) に↑どういうこと?と尋ねたところ、ECS Exec できる状態にないから
aws cli で --enable-execute-command オプションをつけてタスク起動しろとのこと。
というわけで、これが欲しくなった次第。