我在.awscredentials文件中设置了多个配置文件。
从Windows 10命令行我尝试了两种方法https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html
aws cp s3://bucketname etc…——概要profile1
setx AWS_PROFILE profile1
这两种情况都使我"无法找到凭证"。
我在Python中使用这些配置文件没有任何问题。
这是"aws配置列表"的输出。命令:
C:Usersnwalt>aws configure list
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key <not set> None None
secret_key <not set> None None
region us-east-1 config-file ~/.aws/config
但是如果我输入"aws configure list——profile profile"然后我看到配置文件名称,并填写了键。
原来,我没有仔细阅读。在添加——profile profile1之后,错误变成了"访问被拒绝",这是完全不同的东西。
我留下这个问题,因为它可能有助于人们了解如何使用多个配置文件。