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

Configuring the Amazon ECS CLI

The Amazon ECS CLI requires some basic configuration information before you can use it, such as your AWS credentials, the AWS region in which to create your cluster, and the name of the Amazon ECS cluster to use with the ecs-cli configure command. These settings are stored in the ~/.ecs/config file.

AWS Credentials

The Amazon ECS CLI requires your AWS credentials to make calls to AWS APIs on your behalf (for more information, see Managing Access Keys for your AWS Account in the Amazon Web Services General Reference). You can configure your AWS credentials in several ways:

  • You can set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables. When you run ecs-cli configure, the values of those variables are stored in the Amazon ECS CLI configuration file.

  • You can use a named profile from the ~/.aws/credentials file on your system, if you have previously configured your AWS credentials there for another tool, such as the AWS CLI. You can follow the Quick Configuration instructions in the AWS Command Line Interface User Guide to set up a default profile if you have not already done so. You can then pass this named profile as --profile default when you run the ecs-cli configure command.

  • You can pass credentials directly on the command line with the --access-key and --secret-key options.

To configure the Amazon ECS CLI

  • Configure the CLI with the following command, substituting us-west-2 with your desired AWS region, ecs-cli-demo with the name of an existing Amazon ECS cluster or a new cluster to use, and the $AWS_ACCESS_KEY_ID and $AWS_SECRET_ACCESS_KEY environment variables with your AWS credentials.

    Copy
    $ ecs-cli configure --region us-west-2 --access-key $AWS_ACCESS_KEY_ID --secret-key $AWS_SECRET_ACCESS_KEY --cluster ecs-cli-demo INFO[0000] Saved ECS CLI configuration for cluster (ecs-cli-demo)

After you have installed and configured the CLI, you can try the Amazon ECS CLI Tutorial. For more information, see the ECS CLI Command Line Reference.