在AWS CLI中配置访问密钥时,凭据和配置文件创建存在问题。使用"$ aws configure --profile xxxxx"
命令时。它以前工作得很好,"$ aws configure --profile xxxxx"
会创建。aws/config和。aws/凭据文件,通过这些文件我可以运行任何aws命令,而通过cli在任何驱动器或文件夹中。我卸载并重新安装了最新版本的AWS CLI。现在"$ aws configure --profile xxxxx"
只是在相同的旧路径(C:UsersProfile)中创建。awsconfig和。awscredentials文件。
- 我可以运行任何aws命令并获得所需的输出。
- 但是,当我改变我的路径,像移动到另一个文件夹,它通过一个错误
"The config profile (xxxxx) could not be found".
AWS中没有关于此问题的文档。
我能够找到这个问题。我想设置环境变量,所以使用美元对于setx命令
$setx AWS_ACCESS_KEY_ID
$setx AWS_SECRET_ACCESS_KEY
$setx AWS_DEFAULT_REGION
$setx AWS_PROFILE
$setx AWS_CREDENTIAL_FILE
$setx AWS_CONFIG_FILE
因此,每当我尝试$aws configure
而不是.aws
文件夹时,.awsconfig和. awscredals文件被创建,它们不是全局的。通过使用$unset
,我可以删除所有这些,$aws configure
现在创建folder .aws with config and credentials files.
希望这有帮助。@DanielScott