Skip to content

Request for Adding --enable-execute-command Option to ecspresso run #854

@sogaoh

Description

@sogaoh

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:

  1. Compress the checked-out repository.
  2. Install necessary tools: mise, yq, ecspresso, ecsta, awscliv2, session-manager-plugin.
  3. Authenticate with AWS using OIDC.
  4. Start an ECS Task using ecspresso run.
  5. Use ecsta to send the compressed repository and a .env file (referenced during migration) into the ECS Task.
  6. 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 の単体で実現しようとしています。

大雑把な流れとして以下を組んでいて、それぞれ単体では期待動作を確認できています。

  1. checkout したリポジトリを圧縮しておく
  2. 各種インストール(mise、yq、ecspresso、ecsta、awscliv2、session-manager-plugin)
  3. AWSに認証を通す(OIDC)
  4. ecspresso run で ECS Task 起動
  5. ecsta を利用して 1.で圧縮したリポジトリとマイグレーション実行時に参照する .env を作って ECS Task に送り込む
  6. 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

Image

AI (Perplexity) に↑どういうこと?と尋ねたところ、ECS Exec できる状態にないから
aws cli で --enable-execute-command オプションをつけてタスク起動しろとのこと。

というわけで、これが欲しくなった次第。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions