Skip to content

Add support for ECS Exec

What does this MR do?

It adds support for ECS Exec by adding the EnableExecuteCommand flag to the RunTaskInput Go SDK type.

Why was this MR needed?

It enables troubleshooting a running Fargate container (ci-coordinator) by allowing a user to do the equivalent of docker exec into it.

Also, it enables you to do cool things like (partly) support the image CI keyword and other things.

What's the best way to test this MR?

  1. Add EnableExecuteCommand = true to the "[Fargate]" section of fargate.toml:
[Fargate]
# ...other config...
EnableExecuteCommand = true
  1. Run a CI job that has a sleep 120 script step or similar.

  2. Run:

aws ecs execute-command \
  --region "<region>" \
  --cluster "<cluster-name>" \
  --task "<task-arn or task-id>" \
  --container "ci-coordinator" \
  --command "/bin/bash" \
  --interactive

This gives an interactive ssh-like bash session in the running container.

What are the relevant issue numbers?

Edited by Axel von Bertoldi

Merge request reports