ECS CLI currently only support one cluster configuration which results in a number of issues for the users:
- When customer switch clusters or regions within the same account, they need to reconfigure the setup.
- When customer is running two Jenkins builds simultaneously, the config file gets reconfigured while one job is still processing.
- When customers work as a team, each person has to run
ecs-cli configure
to configure the correct cluster and region. - Everything (cluster name, region, creds) should be configurable via arguments or environment variables.
When users run ecs-cli configure
, ECS CLI will configure their cluster configuration in ~/.ecs/ecs.config
default: beta
cluster-configurations:
beta:
- cluster: cli-demo
- region: us-west-2
gamma:
- cluster: cli-demo2
- region: us-west-1
prod:
- ...
When users run ecs-cli configure profile
, ECS CLI will configure their credentials in ~/.ecs/ecs.profile
default: my_profile
ecs_profiles:
my_profile:
- aws_access_key_id : **********
- aws_secret_access_key : **********
dev_profile:
- aws_access_key_id : **********
- aws_secret_access_key : **********
team_profile:
- ...
Other commands will have additional flags
- --cluster-config
- --cluster
- --region
- --aws-profile (this is --profile today)
- --ecs-profile
- Configure ECS credentials (Stores in
~/.ecs/ecs.profile
)ecs-cli configure profile --access-key ********** --secret-key ********** --profile-name my_profile
- Configure cluster (Stores in
~/.ecs/ecs.config
)ecs-cli configure --cluster cli-demo --region us-west-2 --config-name beta_config
- Spin up a cluster
ecs-cli up
- Run tasks
ecs-cli compose up
- Configure another ECS profile
ecs-cli configure profile --access-key ********** --secret-key ********** --profile-name gamma_profile
- Set default ECS profile
ecs-cli configure profile default --profile-name gamma_profile
- Configure another cluster
ecs-cli configure --cluster cli-demo --region us-west-2 --config-name gamma_config
- Set default cluster
ecs-cli configure default --config-name gamma_config
- Spin up a cluster
ecs-cli up
- Run tasks
ecs-cli compose up
- Configure ECS profile
ecs-cli configure profile --access-key ********** --secret-key ********** --profile-name my_profile
- Configure and spin up the first cluster
ecs-cli configure --cluster cli-demo --region us-west-2 --config-name beta_config ecs-cli up --cluster-config beta_config
- Configure and spin up a second cluster
ecs-cli configure --cluster cli-demo2 --region us-west-2 --config-name prod_config ecs-cli up --cluster-config prod_config
- Run tasks on different clusters
ecs-cli compose up --cluster-config beta_config ecs-cli compose up --cluster-config beta_config
- Do the same on a different account
ecs-cli configure profile --access-key ********** --secret-key ********** --profile-name prod_profile ecs-cli up --cluster-config prod_config --ecs-profile prod_profile ecs-cli compose up --cluster-config prod_config --ecs-profile prod_profile
- Do the same with AWS profile
ecs-cli up --cluster-config prod_config --aws-profile default ecs-cli compose up --cluster-config prod_config --aws-profile default
Does not need to configure cluster
- Configure ECS profile
ecs-cli configure profile --access-key ********** --secret-key ********** --profile-name my_profile
- Cluster PS
ecs-cli ps --cluster cli-demo --region us-west-2 --ecs-profile my_profile
- Do the same with AWS profile
ecs-cli ps --cluster cli-demo --region us-west-2 --aws-profile default