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

ecs-cli configure

Description

Configures your AWS credentials, the AWS region to use, resource creation prefixes, and the ECS cluster name to use with the Amazon ECS CLI. The resulting configuration is stored in the ~/.ecs/config file.

Each time you run the ecs-cli configure command, the configuration values in ~/.ecs/config are replaced with the values from the latest command (and if existing configuration parameters are not specified with their associated option flags or environment variables, they are removed or replaced with the default values).

Syntax

ecs-cli configure [--region region] [--access-key aws_access_key_id] [--secret-key aws_secret_access_key] [--profile profile_name] --cluster cluster_name [--compose-project-name-prefix prefix] [--compose-service-name-prefix prefix] [--cfn-stack-name-prefix prefix] [--help]

Options

Name Description

--region, -r region

Specifies the region to use. If the AWS_REGION environment variable is set when ecs-cli configure is run, then the region is set to the value of that environment variable.

Type: String

Required: No

--access-key aws_access_key_id

Specifies the AWS access key to use. If the AWS_ACCESS_KEY_ID environment variable is set when ecs-cli configure is run, then the AWS access key ID is set to the value of that environment variable.

Type: String

Required: No

--secret-key aws_secret_access_key

Specifies the AWS secret key to use. If the AWS_SECRET_ACCESS_KEY environment variable is set when ecs-cli configure is run, then the AWS secret access key is set to the value of that environment variable.

Type: String

Required: No

--profile, -p profile_name

Specifies your AWS credentials with an existing named profile from ~/.aws/credentials. If the AWS_PROFILE environment variable is set when ecs-cli configure is run, then the AWS named profile is set to the value of that environment variable.

Type: String

Required: No

--cluster, -c cluster_name

Specifies the 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.

Type: String

Required: Yes

--compose-project-name-prefix prefix

Specifies the prefix to add to an ECS task definition that is registered from a compose file. You can specify an empty string (--compose-project-name-prefix "") with this option to omit the default prefix.

Important

This prefix is used to name and later manage resources created by the Amazon ECS CLI. Resources that are created with a prefix are only addressable from the Amazon ECS CLI if the configured prefix matches the prefix that was used when the resource was created. Before you change the prefix value, you should consider the effects on any active resources.

Type: String

Default: ecscompose-

Required: No

--compose-service-name-prefix prefix

Specifies the prefix to add to an ECS service that is created from a compose file. You can specify an empty string (--compose-service-name-prefix "") with this option to omit the default prefix.

Important

This prefix is used to name and later manage resources created by the Amazon ECS CLI. Resources that are created with a prefix are only addressable from the Amazon ECS CLI if the configured prefix matches the prefix that was used when the resource was created. Before you change the prefix value, you should consider the effects on any active resources.

Type: String

Default: ecscompose-service-

Required: No

--cfn-stack-name-prefix prefix

Specifies the prefix to add to the AWS CloudFormation stack that is created on ecs-cli up. You can specify an empty string (--cfn-stack-name-prefix "") with this option to omit the default prefix.

Important

This prefix is used to name and later manage resources created by the Amazon ECS CLI. Resources that are created with a prefix are only addressable from the Amazon ECS CLI if the configured prefix matches the prefix that was used when the resource was created. Before you change the prefix value, you should consider the effects on any active resources.

Type: String

Default: amazon-ecs-cli-setup-

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 and use a cluster called ecs-cli in the us-west-2 region.

Copy
ecs-cli configure --region us-west-2 --access-key $AWS_ACCESS_KEY_ID --secret-key $AWS_SECRET_ACCESS_KEY --cluster ecs-cli

Output:

INFO[0000] Saved ECS CLI configuration for cluster (ecs-cli)

Example

This example configures the Amazon ECS CLI to create and/or use a cluster called ecs-cli in the us-west-2 region and omit the default Amazon ECS CLI prefixes on future resource creation.

Note

Any existing resources, such as task definitions, services, or AWS CloudFormation stacks, that were created with the default prefixes will not be addressable from the Amazon ECS CLI until the configured prefix matches the prefix that was used when the resource was created.

Copy
ecs-cli configure --region us-west-2 --access-key $AWS_ACCESS_KEY_ID --secret-key $AWS_SECRET_ACCESS_KEY --cluster ecs-cli --compose-project-name-prefix "" --compose-service-name-prefix "" --cfn-stack-name-prefix ""

Output:

INFO[0000] Saved ECS CLI configuration for cluster (ecs-cli)