DEV Community

Reishi Mitani
Reishi Mitani

Posted on

Installing ECS-CLI in your Mac

Prerequisites

MacOS Catalina
More information can be found here in the documentation: Installing the Amazon ECS CLI

Procedures

Download ecs-cli using sudo curl.

$ sudo curl -Lo /usr/local/bin/ecs-cli https://amazon-ecs-cli.s3.amazonaws.com/ecs-cli-darwin-amd64-latest
Password:
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 49.5M  100 49.5M    0     0  3419k      0  0:00:14  0:00:14 --:--:-- 4012k
Enter fullscreen mode Exit fullscreen mode

Install gnupg, or GNU privacy guard. This may take a few minutes.

$ brew install gnupg
Enter fullscreen mode Exit fullscreen mode

Run the following command. This will retrieve the key.

$ gpg --keyserver hkp://keys.gnupg.net --recv BCE9D9A42D51784F
gpg: directory '/Users/USERNAME/.gnupg' created
gpg: keybox '/Users/USERNAME/.gnupg/pubring.kbx' created
gpg: /Users/USERNAME/.gnupg/trustdb.gpg: trustdb created
gpg: key BCE9D9A42D51784F: public key "Amazon ECS <ecs-security@amazon.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1
Enter fullscreen mode Exit fullscreen mode

Download the ECS CLI signatures.

$ curl -Lo ecs-cli.asc https://amazon-ecs-cli.s3.amazonaws.com/ecs-cli-darwin-amd64-latest.asc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   821  100   821    0     0   1080      0 --:--:-- --:--:-- --:--:--  1078

Enter fullscreen mode Exit fullscreen mode

Verigy the key.

$ gpg --verify ecs-cli.asc /usr/local/bin/ecs-cli
gpg: Signature made 水  7/ 8 07:29:27 2020 JST
gpg:                using RSA key DE3CBD61ADAF8B8E
gpg: Good signature from "Amazon ECS <ecs-security@amazon.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: F34C 3DDA E729 26B0 79BE  AEC6 BCE9 D9A4 2D51 784F
     Subkey fingerprint: EB3D F841 E2C9 212A 2BD4  2232 DE3C BD61 ADAF 8B8E
Enter fullscreen mode Exit fullscreen mode

Add the necessary restrictions.

$ sudo chmod +x /usr/local/bin/ecs-cli
Enter fullscreen mode Exit fullscreen mode

If you are able to check the version, it is successful.

$ ecs-cli --version
ecs-cli version 1.20.0 (7547c45)
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
rahulmhjn profile image
Rahul Mahajan

Thanks