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
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_SECRET_ACCESS_KEYenvironment 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/credentialsfile 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
defaultprofile if you have not already done so. You can then pass this named profile as
--profile defaultwhen you run the ecs-cli configure command.
You can pass credentials directly on the command line with the
To configure the Amazon ECS CLI
Configure the CLI with the following command, substituting
us-west-2with your desired AWS region,
ecs-cli-demowith the name of an existing Amazon ECS cluster or a new cluster to use, and the
environment variables with your AWS credentials.
ecs-cli configure --region
INFO Saved ECS CLI configuration for cluster (ecs-cli-demo)