aws ssm start-session fails with TargetNotConnected on ECS on Fargate
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 357
- PR merge metrics
- No merged PRs in 30d
Description
I have ECS running with Fargate launchtype: the containers are running successfully, however to troubleshoot/debug an issue I tried the
AWS ECS Exec, however while trying with the https://github.com/aws-containers/amazon-ecs-exec-checker all checks are passed, it only shows in red
```
Managed Agent Status
----------
1. STOPPED (Reason: null) for "containernameredacted" - LastStartedAt: null
```
Since there are many reports of ECS Exec not working & based on this comment https://github.com/aws/amazon-ssm-agent/issues/361#issuecomment-1007335151 I tried using the
aws ssm start-session --target ecs:.... but it throws TargetNotConnected error,
```
aws ssm start-session --target ecs:clusternameredacted_e7e36d0d4e744104bd4d225c44daddfe_e7e36d0d4e744104bd4d225c44daddfe-3839356491
An error occurred (TargetNotConnected) when calling the StartSession operation: ecs:clusternameredacted_e7e36d0d4e744104bd4d225c44daddfe_e7e36d0d4e744104bd4d225c44daddfe-3839356491 is not connected
```
so my questions is
- is it not possible to connect to containers running on ECS with fargate launchtype
- Is any config missing for the aws ssm start-session for ECS Fargate?
If somebody has already faced this targetnotconnected for ssm start-session please do guide on the solution?
Contributor guide
Research direction
Start by reproducing the reported `aws ssm start-session --target ecs:...` command and reviewing the ECS Exec Checker output, especially the STOPPED managed agent status. Determine from the agent and ECS integration entry points whether Fargate targets are expected to support this session path and identify the configuration or documentation needed to explain the TargetNotConnected result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, go
- Domain
- cloud, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100