I am running aws ecs execute-command --cluster UltimaF --task 838d773b17954bcfbbacf343fb4fea70 --container ultima --interactive --command "/bin/sh"
Getting back: An error occurred (InvalidParameterException) when calling the ExecuteCommand operation: 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.
I have ensured that:
- The task is running.
aws ecs describe-tasks --cluster UltimaF --tasks 838d773b17954bcfbbacf343fb4fea70
returns"enableExecuteCommand": true
- Task role has the following permissions attached:
ssmmessages:CreateControlChannel
ssmmessages:CreateDataChannel
ssmmessages:OpenControlChannel
ssmmessages:OpenDataChannel
I am running on Windows, aws-cli/2.8.2
UPDATE: after running ecs exec checker I have two yellow items and one red:
----------
Managed Agent Status
----------
1. STOPPED (Reason: null) for "ultima" - LastStartedAt: null
----------
Init Process Enabled (first-run-task-definition:12)
----------
1. Disabled - "ultima"
UPDATE two:
This issue suggests
ecs:clustername_taskid_containerruntimeid
but for me it returns an error: An error occurred (TargetNotConnected) when calling the StartSession operation: ecs:UltimaF_838d773b17954bcfbbacf343fb4fea70_838d773b17954bcfbbacf343fb4fea70-2587323273 is not connected.
Question: How do I connect?