且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用AWS S3 Java SDK,确定授权(访问密钥和秘密密钥)是否正确的最快方法是什么?

更新时间:2022-04-18 21:26:26

类似的检查在AWS中不提供任何值.访问密钥和秘密密钥可以匹配,但是可能没有任何IAM策略,或者该策略可能仅限于IAM用户.因此,仅因为密钥有效并不意味着您就可以列出存储桶或使用这些凭据下载文件.

A check like that does not provide any value in AWS. An access key and a secret key may match but there may not be any IAM policies or the policies may be limited for the IAM user. So just because the keys are valid doesn't mean you'll be able to list buckets or download a file with those credentials.

您应该检查S3操作的结果,以确定权限是否不足以执行该操作,并在那时采取相应措施.

You should check the result of the S3 operation to determine if the permissions were insufficient for the operation and act accordingly at that time.