简体   繁体   English

如何为多个区域的账户配置AWS CLI

[英]How to configure AWS CLI for an account for multiple regions

我正在使用AWS CLI在不同区域中设置ECS集群,因此如何在两个不同区域的实例上配置AWS CLI。

You can simply specify the region the AWS CLI should operate on. 您只需指定AWS CLI应该在其上运行的区域即可。 Either use the command line parameter --region , like: 使用命令行参数--region ,例如:

aws --region us-east-1 ecs ...

And alternative is to use the environment variable AWS_DEFAULT_REGION , like: 另一种选择是使用环境变量 AWS_DEFAULT_REGION ,例如:

AWS_DEFAULT_REGION=us-east-1 aws ecs ...

A third option would be to configure multiple profiles for the AWS CLI in ~/.aws/config and set a different region for each profile. 第三种选择是在~/.aws/config为AWS CLI配置多个配置文件 ,并为每个配置文件设置不同的区域。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM