Issue
I am using Amazon Linux AMI Ec2 instance.When I try to deploy task getting error like ecs not found
bash-4.2$ ecs deploy demo-cluster demo-service
bash: ecs: command not found
When I try to start ecs its already running
[ec2-user@ip-152-31-44-88 ~]$ sudo start ecs
start: Job is already running: ecs
Solution
To my knowledge, there is no such command installed on ECS ready AMIs.
Some observations regarding your question:
The ecs service you see running is the Amazon ECS Container Agent. This is a system level service, not a command line cli. See https://github.com/aws/amazon-ecs-agent.
Yes the AWS CLI is installed, but it is called via the
aws
command, not theecs
command.There is a AWS supported ecs cli, but it is invoked with the
ecs-cli
command, and has no deployment option. See https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_CLI_reference.htmlThe only tool that I found that supports the command
ecs deploy
is a 3rd party tool on GitHub. See https://github.com/fabfuel/ecs-deploy. As this is a 3rd party tool, you need to nstall it on the instance or on your local computer.
Answered By - Rodrigo M