哪个版本的 s3cmd 支持 IAM 角色?

Which version of s3cmd does support IAM Roles?

我使用的是最新版本的 s3cmd 1.5.2。按照这个 post, 1.5.0-alpha2 supports IAM Roles, so I am assuming this must be supported in 1.5.2 as well. I added "security_token" in s3cfg file as mentioned in this post。但我仍然收到错误 "ERROR: S3 error: The AWS Access Key Id you provided does not exist in our records." 是我做错了什么还是这个版本不支持 IAM 角色?

这几天,推荐使用AWS Command-Line Interface (CLI)

与使用 AWS SDK 的任何软件一样,如果使用角色启动 Amazon EC2 实例,AWS CLI 将自动使用基于角色的凭证。凭据也可以通过环境变量或配置文件指定。

我自己想出了答案。在深入研究 s3cmd 代码后,发现我们需要添加“access_token" 在 s3cfg 文件中。如果您在与角色关联的集群上使用 s3cmd,则也无需传递任何 s3cfg 文件。 1.5.0-alpha2 及更高版本 的所有版本都支持 IAM 角色。