I recently needed to copy a few small text files into a container running in AWS Fargate. I assumed it would be an easy matter of copying it through the terminal session, but that is, unfortunately, not the case.
I was accessing the containers via the aws ecs execute-command --interactive --comand "bash" mechanism. If you’re not familiar, this is a quick way to get a terminal inside an ECS container running in any cluster. It’s especially helpful when you have containers that do not receive incoming traffic from the internet. It is almost like SSH, but it is not exactly SSH. And one of the limitations is that there is no equivalent to scp. There is also no ability to forward ports, so you can’t use it to access SSH either.