ecs-cli configure
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.
Some features described might only be available with the latest version of the Amazon ECS CLI. For more information about obtaining 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.
Ensure that 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
[--config-name
config_name
] [--cfn-stack-name
stack_name
] [--default-launch-type
launch_type
] [--help]
Options
Name |
Description |
---|---|
|
Specifies the Amazon ECS cluster name to use. Defaults to the cluster configured using the configure command. Type: String Required: Yes |
|
Specifies the AWS Region to use. Defaults to the Region configured using either the ecs-cli configure or aws configure commands. Type: String Required: Yes |
|
Specifies the name of this cluster configuration. This is the name
that can be referenced in commands using the
Type: String Required: No |
|
Specifies the stack name to add to the AWS CloudFormation stack that is created on ecs-cli up. 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:
Required: No |
|
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 |
|
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-east-1
region.
ecs-cli configure --region
us-east-1
--clusterecs-cli-demo
--default-launch-typeFARGATE
--config-nameecs-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: ecs-cli-demo clusters: ecs-cli-demo: cluster: ecs-cli-demo region: us-east-1 default_launch_type: FARGATE