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

ecs-cli configure

Description

Configures the AWS region to use, resource creation prefixes, and the Amazon 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.

Important

Some features described may only be available with the latest version of the ECS CLI. To obtain the latest version, see Installing the Amazon ECS CLI.

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.

Note

Ensure you are using the latest version of the Amazon ECS CLI to use all configuration options.

Syntax

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

Options

Name Description

--cluster, -c cluster_name

Specifies the ECS cluster name to use. Defaults to the cluster configured using the configure command.

Type: String

Required: Yes

--region, -r region

Specifies the AWS region to use. Defaults to the cluster configured using the configure command.

Type: String

Required: Yes

--config-name config_name

Specifies the name of this cluster configuration. This is the name that can 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

--default-launch-type launch_type Specifies the default launch type to use. Valid values are FARGATE or EC2. If not specified, no default launch type is used. For more information about launch types, see Amazon ECS Launch Types.

Type: String

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 FARGATE as the default launch type for cluster ecs-cli-demo in the us-west-2 region.

ecs-cli configure --region us-west-2 --cluster ecs-cli-demo --default-launch-type FARGATE --config-name ecs-cli-demo

Output:

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

Contents of the ~/.ecs/config file after running the command:

version: v1 default: fargate clusters: ecs-cli-demo: cluster: ecs-cli-demo region: us-west-2 default_launch_type: "FARGATE"