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

ecs-cli configure

Description

Configures the AWS region to use, resource creation prefixes, and the ECS cluster name to use with the Amazon ECS CLI. Stores a single named cluster configuration in the ~/.ecs/config file. The first cluster configuration that is created is set as the default.

Working with Multiple Cluster Configurations

The following should be noted when using multiple cluster configurations:

  • Multiple cluster configurations may be stored, but one is always the default.

  • The first cluster configuration that is stored is set as the default.

  • Use the ecs-cli configure default command to change which cluster configuration is set as the default. For more information, see ecs-cli configure default

  • A non-default cluster configuration can be referenced in a command by using the --cluster-config flag.

For more information, see ecs-cli configure default.

Syntax

ecs-cli configure --cluster cluster_name [--region region] [--config-name config_name] [--cfn-stack-name stack_name] [--help]

Options

Name Description

--cluster, -c cluster_name

Specifies the Amazon ECS cluster name to use. If the cluster does not exist, it is created when you try to add resources to it with the ecs-cli up command. If the ECS_CLUSTER environment variable is set then the cluster is set to the value of that environment variable when running commands.

Type: String

Required: Yes

--region, -r region

Specifies the region to use. If the AWS_REGION environment variable is set then the region is set to the value of that environment variable when running commands.

Type: String

Required: Yes

--config-name config_name

Specifies the name of this cluster configuration. This is the name that will then be able to be referenced in commands using the --cluster-config flag. If this option is omitted, then the name is set to default.

Type: String

Required: No

--cfn-stack-name stack_name

Specifies the stack name to add to the AWS CloudFormation stack that is created on ecs-cli up.

Important

It is not recommended to use this parameter, it is included to ensure backwards compatibility with previous versions of the ECS CLI.

Type: String

Default: amazon-ecs-cli-setup-<cluster_name>

Required: No

--help, -h

Shows the help text for the specified command.

Required: No

Examples

Example

This example configures the Amazon ECS CLI to create a cluster configuration named ecs-cli-demo which uses cluster ecs-cli-demo in the us-west-2 region.

Copy
ecs-cli configure --region us-west-2 --cluster ecs-cli-demo --config-name ecs-cli-demo

Output:

INFO[0000] Saved ECS CLI cluster configuration ecs-cli-demo.