Python 如何解决这个问题;botocore.exceptions.ClientError:发生错误(AccessDenied)";错误?

Python 如何解决这个问题;botocore.exceptions.ClientError:发生错误(AccessDenied)";错误?,python,mongodb,amazon-web-services,pymongo,boto3,Python,Mongodb,Amazon Web Services,Pymongo,Boto3,当我尝试生成凭证报告时,会弹出此错误 botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the GenerateCredentialReport operation: User: arn:aws:iam::111111111111:user/freshers is not authorized to perform: iam:GenerateCredentialReport on reso

当我尝试生成凭证报告时,会弹出此错误

botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the GenerateCredentialReport operation: User: arn:aws:iam::111111111111:user/freshers is not authorized to perform: iam:GenerateCredentialReport on resource: *

如何修复/解决此问题?

基于评论


解决方案是向用于执行boto3脚本的iam用户或角色添加缺少的权限
iam:GenerateCredentialReport

您必须向用于执行脚本的iam用户或角色添加缺少的权限
iam:GenerateCredentialReport
。是的,我是否必须签入AWS?@MarcinYes。您必须转到您使用的IAM用户或IAM角色,并在IAM控制台中添加缺少的权限。如果您自己没有添加此类权限的权限,那么必须以JSON格式询问帐户的admin.ya,对吗?比如{“版本”:“2012-10-17”,“声明”:{“效果”:“允许”,“行动”:[“iam:GenerateCredentialReport”,“iam:GetCredentialReport”],“资源”:“*”}}@Navi对不起,我现在不想分享。