Why didn't I receive any messages from SQS after creating a rule schedule and sending a target to SQS by AWS SDK?

0

You can take a look my sample code here

 const rule = await this.eventBridge
      .putRule({
        Name: payload.name,
        // EventBusName: 'eventbustest',
        ScheduleExpression: payload.expression,
        Description: payload.description,
        State: 'ENABLED',
      })
      .promise();
    const target = await this.eventBridge
      .putTargets({
        Rule: payload.name,
        Targets: [
          {
            Arn: payload.sqsTarget.arn,
            Id: payload.sqsTarget.id,
            Input: JSON.stringify({ test: 1 }),
          },
        ],
      })
      .promise();

I tried create rule using code then it's not working for SQS side but when I tried create on console then it's working

Ceck
已提问 9 个月前210 查看次数
1 回答
1
已接受的回答

Hi,

please make sure that the SQS access policy and IAM policy allow EventBridge to write messages to the queue. Additionally, check that the ARNs match your resources.

Here is more information: https://repost.aws/knowledge-center/sqs-queue-access-permissions

profile pictureAWS
专家
已回答 9 个月前
  • thank you, i used Account with Administrator Access, I missed for SQS access policy. I tried to reconfigure and it's working for now.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则