Issue
Is there any way of running multiple commands using the AWS Elastic Container Service's execute-command
in the AWS CLI via a calling shell script?
I have managed to connect to my container successfully and create a Bash shell, as per the AWS documentation [1].
region="my-aws-region"
cluster="my-cluster"
task="my-task"
container_name="my-container-name"
cmnd="/bin/bash"
aws ecs execute-command \
--region "$region" \
--cluster "$cluster" \
--task "$task" \
--container $container_name \
--command \""$cmnd"\" \
--interactive
What I need to do is to run a script in the container from the Bash shell.
I have not been able to find any examples of something like this - they all just show the creation of the shell but do no more with it.
Thank you in advance for any assistance.
[1] See https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ecs/execute-command.html
Solution
Unfortunately, I don't think this is possible. I could find no way of supplying parameters to the AWS Elastic Container Service's execute-command
and so had to abandon this change.
Answered By - GarlicBread Answer Checked By - Candace Johnson (WPSolving Volunteer)