AWS单行配置命令

时间:2018-07-24 14:21:01

标签: shell amazon-web-services command-line amazon

我正在尝试使用Ansible配置我的AWS账户,并且据我所知,它需要在一行上(除非Windows命令中有一种方法以编程方式按“ ENTER”键)。

有没有办法做到这一点?

1 个答案:

答案 0 :(得分:-1)

使用aws configure也可以交互设置值,但是使用aws configure set可以直接设置值。

  

简介             aws configure set varname value [--profile profile-name]

OPTIONS
varname (string) The name of the config value to set. 
value (string) The value to set.

例如。

aws configure --profile myprofile set region us-east-1
aws configure --profile myprofile set aws_access_key_id XXXXXXXXXXX
aws configure --profile myprofile set aws_secret_access_key YYYYYYYY

或者,您也可以使用。

aws configure set profile.myprofile.region us-east-1
aws configure set profile.myprofile.aws_access_key_id XXXXXXXXXXX
aws configure set profile.myprofile.aws_secret_access_key YYYYYYYY