SQS政策是否有优先权?

SQS policy is there a precedence?

我有一个队列,其策略允许通过服务角色执行 sendMessage、receiveMessage 操作(Principal 具有角色 arn)。 Lambda 和其他服务使用此角色向此队列发送消息。

我还有一个 AWS 控制台开发人员角色,允许我通过控制台发送消息(SQS 发送、接收消息选项)。

如果 SQS 策略明确允许 sendMessage 仅用于服务角色,我如何能够通过 AWS 控制台post?

来自Using identity-based policies with Amazon SQS - Amazon Simple Queue Service

Using Amazon SQS and IAM policies
There are two ways to give your users permissions to your Amazon SQS resources: using the Amazon SQS policy system and using the IAM policy system. You can use one or the other, or both. For the most part, you can achieve the same result with either one.

There is one major difference between IAM and Amazon SQS policies: the Amazon SQS policy system lets you grant permission to other AWS Accounts, whereas IAM doesn't.

基本上,您可以使用 SQS 策略 IAM 策略。如果其中一个允许该操作,并且没有一个拒绝该操作,则该操作将被允许。

当您使用 Amazon SQS 控制台时,您很可能正在使用已分配给您的 IAM 权限。如果它授予必要的权限,则不需要 SQS 策略。