Menu
Amazon Elastic Container Service
Developer Guide (API Version 2014-11-13)

Installing the Amazon ECS CLI

Follow these instructions to install the Amazon ECS CLI on your macOS, Linux, or Windows system.

Step 1: Download the Amazon ECS CLI

Download the ECS CLI binary.

  • For macOS:

    sudo curl -o /usr/local/bin/ecs-cli https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-darwin-amd64-latest
  • For Linux systems:

    sudo curl -o /usr/local/bin/ecs-cli https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-linux-amd64-latest
  • For Windows systems:

    Open Windows PowerShell and run the following commands:

    PS C:\> New-Item ‘C:\Program Files\Amazon\ECSCLI’ -type directory PS C:\> Invoke-WebRequest -OutFile ‘C:\Program Files\Amazon\ECSCLI\ecs-cli.exe’ https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-windows-amd64-latest.exe

    Note

    If you encounter permissions issues, ensure that you are running PowerShell as an administrator.

Step 2: (Optional) Verify the Amazon ECS CLI

To verify the validity of the Amazon ECS CLI file, you can either use the provided MD5 sum or the PGP signatures. Both methods are described in the following sections.

Verify Using the MD5 Sum

Verify the downloaded binary with the MD5 sum provided.

  • For macOS (compare the two output strings to verify that they match):

    curl -s https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-darwin-amd64-latest.md5 && md5 -q /usr/local/bin/ecs-cli
  • For Linux systems (look for an OK in the output string):

    echo "$(curl -s https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-linux-amd64-latest.md5) /usr/local/bin/ecs-cli" | md5sum -c -
  • For Windows systems:

    Open Windows PowerShell and find the md5 hash of the executable that you downloaded:

    PS C:\> Get-FileHash ecs-cli.exe -Algorithm MD5

    Compare that with this md5 hash:

    PS C:\> Invoke-WebRequest -OutFile md5.txt https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-windows-amd64-latest.md5 PS C:\> Get-Content md5.txt

Verify Using the PGP Signature

The ECS CLI executables are cryptographically signed using PGP signatures. You can use the following steps to verify the signatures using the GnuPG tool.

  1. Download and install GnuPG. For more information about GNUpg, see the GnuPG website.

    • For macOS, we recommend using Homebrew. Install Homebrew using the instructions from their website. For more information, see Homebrew. After Homebrew is installed, use the following command from your macOS terminal:

      brew install gnupg
    • For Linux systems, install gpg using the package manager on your flavor of Linux.

    • For Windows systems, download and use the Windows simple installer from the GnuPG website. For more information, see GnuPG Download.

  2. Retrieve the Amazon ECS PGP public key. You can use a command to do this or manually create the key and then import it.

    1. Option 1: Retrieve the key with the following command.

      gpg --keyserver hkp://keys.gnupg.net --recv BCE9D9A42D51784F
    2. Option 2: Create a file with the following contents of the Amazon ECS PGP public key and then import it:

      -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v2.0.18 (GNU/Linux) mQINBFq1SasBEADliGcT1NVJ1ydfN8DqebYYe9ne3dt6jqKFmKowLmm6LLGJe7HU jGtqhCWRDkN+qPpHqdArRgDZAtn2pXY5fEipHgar4CP8QgRnRMO2fl74lmavr4Vg 7K/KH8VHlq2uRw32/B94XLEgRbGTMdWFdKuxoPCttBQaMj3LGn6Pe+6xVWRkChQu BoQAhjBQ+bEm0kNy0LjNgjNlnL3UMAG56t8E3LANIgGgEnpNsB1UwfWluPoGZoTx N+6pHBJrKIL/1v/ETU4FXpYw2zvhWNahxeNRnoYj3uycHkeliCrw4kj0+skizBgO 2K7oVX8Oc3j5+ZilhL/qDLXmUCb2az5cMM1mOoF8EKX5HaNuq1KfwJxqXE6NNIcO lFTrT7QwD5fMNld3FanLgv/ZnIrsSaqJOL6zRSq8O4LN1OWBVbndExk2Kr+5kFxn 5lBPgfPgRj5hQ+KTHMa9Y8Z7yUc64BJiN6F9Nl7FJuSsfqbdkvRLsQRbcBG9qxX3 rJAEhieJzVMEUNl+EgeCkxj5xuSkNU7zw2c3hQZqEcrADLV+hvFJktOz9Gm6xzbq lTnWWCz4xrIWtuEBA2qE+MlDheVd78a3gIsEaSTfQq0osYXaQbvlnSWOoc1y/5Zb zizHTJIhLtUyls9WisP2s0emeHZicVMfW61EgPrJAiup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nAEPsalrCdtaNUBHRXA0OQxG AHMOdJQQvBsmqMvuAdjkDWpFu5y0My5ddU+hiUzUyQLjL5Hhd5LOUDdewlZgIw1j xrEAUzDKetnemM8GkHxDgg8koev5frmShJuce7vSjKpCNg3EIJSgqMOPFjJuLWtZ vjHeDNbJy6uNL65ckJy6WhGjEADS2WAW1D6Tfekkc21SsIXk/LqEpLMR/0g5OUif wcEN1rS9IJXBwIy8MelN9qr5KcKQLmfdfBNEyyceBhyVl0MDyHOKC+7PofMtkGBq 13QieRHv5GJ8LB3fclqHV8pwTTo3Bc8z2g0TjmUYAN/ixETdReDoKavWJYSE9yoM aaJu279ioVTrwpECse0XkiRyKToTjwOb73CGkBZZpJyqux/rmCV/fp4ALdSW8zbz FJVORaivhoWwzjpfQKhwcU9lABXi2UvVm14v0AfeI7oiJPSU1zM4fEny4oiIBXlR zhFNih1UjIu82X16mTm3BwbIga/s1fnQRGzyhqUIMii+mWra23EwjChaxpvjjcUH 5ilLc5Zq781aCYRygYQw+hu5nFkOH1R+Z50Ubxjd/aqUfnGIAX7kPMD3Lof4KldD Q8ppQriUvxVo+4nPV6rpTy/PyqCLWDjkguHpJsEFsMkwajrAz0QNSAU5CJ0G2Zu4 yxvYlumHCEl7nbFrm0vIiA75Sa8KnywTDsyZsu3XcOcf3g+g1xWTpjJqy2bYXlqz 9uDOWtArWHOis6bq8l9RE6xr1RBVXS6uqgQIZFBGyq66b0dIq4D2JdsUvgEMaHbc e7tBfeB1CMBdA64e9Rq7bFR7Tvt8gasCZYlNr3lydh+dFHIEkH53HzQe6l88HEic +0jVnA== =ArPc -----END PGP PUBLIC KEY BLOCK-----

      The details of the Amazon ECS PGP public key for reference:

      Key ID: BCE9D9A42D51784F Type: RSA Size: 4096/4096 Expires: Never User ID: Amazon ECS Key fingerprint: F34C 3DDA E729 26B0 79BE AEC6 BCE9 D9A4 2D51 784F

      Import the Amazon ECS PGP public key with the following command.

      gpg --import <public_key_filename>
  3. Download the ECS CLI signatures. ECS CLI signatures are ascii detached PGP signatures stored in files with the extension .asc. The signatures file has the same name as its corresponding executable, with .asc appended.

    • For macOS systems:

      curl -o ecs-cli.asc https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-darwin-amd64-latest.asc
    • For Linux systems:

      curl -o ecs-cli.asc https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-linux-amd64-latest.asc
    • For Windows systems:

      PS C:\> Invoke-WebRequest -OutFile ecs-cli.asc https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-windows-amd64-latest.exe.asc
  4. Verify the signature.

    • For macOS and Linux systems:

      gpg --verify ecs-cli.asc /usr/local/bin/ecs-cli
    • For Windows systems:

      gpg --verify ecs-cli.asc 'C:\Program Files\Amazon\ECSCLI\ecs-cli.exe'

    Expected output:

    gpg: Signature made Tue Apr 3 13:29:30 2018 PDT 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

    Note

    The warning in the output is expected and is not problematic; it occurs because there is not a chain of trust between your personal PGP key (if you have one) and the Amazon ECS PGP key. For more information, see Web of trust.

Step 3: Apply Execute Permissions to the Binary

Apply execute permissions to the binary.

  • For macOS and Linux systems:

    sudo chmod +x /usr/local/bin/ecs-cli
  • For Windows systems:

    Edit the environment variables and add C:\Program Files\Amazon\ECSCLI to the PATH variable field, separated from existing entries by using a semicolon. For example:

    C:\existing\path;C:\Program Files\Amazon\ECSCLI

    Restart PowerShell (or the command prompt) so the changes go into effect.

    Note

    Once the PATH variable is set, the ECS CLI can be used from either Windows PowerShell or the command prompt.

Step 4: Complete the Installation

Verify that the CLI is working properly.

ecs-cli --version

Proceed to Configuring the Amazon ECS CLI.

Important

You must configure the ECS CLI with your AWS credentials, an AWS region, and an Amazon ECS cluster name before you can use it.