aws / aws/containers-roadmap

Why AWS exec gives shell access w/ terminal session unlike docker?

Open
#1,536 3 comments 0 reactions 0 assignees View on GitHub
ECS
Dominant language
Shell
Stars
5.4k
Forks
334
PR merge metrics
No merged PRs in 30d

Description

Hello,

**Problem:**
I'm trying to gain the shell access to "AWS fargate container" using "AWS Exec". The problem is that the shell session provided by AWS Exec is with terminal. Why it can't provide w/o terminal alike docker.

**Steps to reproduce:**

1. Get the fargate container shell access using AWS Exec.
```
aws ecs execute-command --region $AWS_REGION --cluster --task --container --command "sh" --interactive

The Session Manager plugin was installed successfully. Use the AWS CLI to start a session.

Starting session with SessionId: ecs-execute-command-
This session is encrypted using AWS KMS.
# ls
bin docker-entrypoint.d home managed-agents opt run sys var
boot docker-entrypoint.sh lib media proc sbin tmp
dev etc lib64 mnt root srv usr
#
```
2. You can see it return shell session with terminal. Why it can't just return shell session w/o terminal?

3. You can see for docker when it take interactive shell, it does not create session with terminal.
e.g.

```
aapuse$ docker run -i ubuntu sh
ls
bin
boot
dev
etc
home
lib
lib32
lib64
libx32
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var
pwd
/

```

**Intentions:**
I would like to access container shell programmatically (i.e. to attach stdin/stdout) which is possible w/o terminal session.
If anyone know if it's possible with terminal session, please let me know.

Contributor guide

Open the contributing guide

Research direction

Start with the shown `aws ecs execute-command` invocation and compare its interactive session behavior with `docker run -i ubuntu sh`. Determine whether AWS Exec supports programmatic stdin/stdout attachment without a terminal; done means the supported behavior or limitation is clearly established.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, docker, shell
Domain
cli, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.