Amazon AWS CLI:如何找出某個角色具有哪些操作/權限/政策?

Amazon AWS CLI:如何找出某個角色具有哪些操作/權限/政策?

我使用的是 Linux 並使用 AWS CLI。

我嘗試運行以下命令:

  • aws iam list-instance-profiles-for-role --role-name role-abc-123
  • aws iam get-role --role-name role-abc-123 --query 'Role.AssumeRolePolicyDocument.Statement[].Action[]'
  • aws iam list-attached-role-policies --role-name role-abc-123

然而,每個人都會回來:

An error occurred (AccessDenied) when calling the XXX operation: User: YYY is not authorized to perform: XXX on resource: role ZZZ because no identity-based policy allows the XXX action

我如何查看我能夠執行哪些操作、哪些策略不符合該角色以及哪些操作不符合該策略?

謝謝

相關內容