简体   繁体   English

在两个不同的AWS账户中提供Feed SQS队列

[英]Feeding SQS Queues available in two different AWS Accounts

For putting messages to SQS Queues and getting a connection, we need to have a key for the account/user. 为了将消息发送到SQS队列并建立连接,我们需要具有帐户/用户的密钥。

I want to feed messages to two queues which are available in two different AWS Accounts. 我想向两个不同的AWS账户中可用的两个队列中馈送消息。 How can I achieve that? 我该如何实现? As far as my understanding is, we can setup only one access/key credentials hence we cannot talk to two queues available in two different AWS Accounts. 据我所知,我们只能设置一个访问/密钥凭证,因此我们无法与两个不同的AWS账户中的两个队列进行对话。

Any help would be appreciated. 任何帮助,将不胜感激。 Thanks! 谢谢!

You can use credentials from one account ("Account A") to make API calls to an Amazon SQS queue in a different account ("Account B"). 您可以使用证书从一个帐户(“帐户A”)来进行API调用到Amazon SQS队列在不同的帐户 (“帐户B”)。

Simply add a policy to the SQS queue in the target account (Account B). 只需将策略添加到目标帐户(帐户B)中的SQS队列中即可。 Here is a sample policy from the Using Identity-Based Policies (IAM) Policies for Amazon SQS documentation: 这是“ 使用针对Amazon SQS的基于身份的策略(IAM)策略”文档中的示例策略:

The following example policy grants AWS account number 111122223333 the SendMessage permission for the queue named 444455556666/queue1 in the US East (Ohio) region. 以下示例策略向美国东部(俄亥俄州)区域中名为444455556666 / queue1的队列的AWS帐号111122223333授予SendMessage权限。

{
  "Version": "2012-10-17",
  "Id": "Queue1_Policy_UUID",
  "Statement": [
    {
      "Sid":"Queue1_SendMessage",
      "Effect": "Allow",
      "Principal": {
        "AWS": "111122223333"
      },
      "Action": "sqs:SendMessage",
      "Resource": "arn:aws:sqs:us-east-2:444455556666:queue1"
    }
  ]  
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM